Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expanding content endpoints in Umbraco Delivery API is hanging when TypedSwagger is enabled #30

Open
bjarnef opened this issue Apr 29, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@bjarnef
Copy link

bjarnef commented Apr 29, 2024

Which version of the package are you using?

12.0.0

Which Umbraco version are you using? For example: 12.2.0 - don't just write v12

12.3.9

Bug summary

I noticed on a project we have Delivery API extensions package enabled expanding content endpoints under Umbraco Delivery API made the application hanging until the browser failed.

We had this configuration:

"DeliveryApiExtensions": {
  "Preview": {
    "Enabled": true,
    "Media": {
      "Enabled": true
    },
    "AllowedUserGroupAliases": [], // All allowed by default
    "ContentAppWeight": -50
  },
  "TypedSwagger": {
    "Enabled": true,
    "Mode": "Auto"
  }
}

after changing TypedSwagger with Enabled": false the Swagger content endpoints expands just fine.

Steps to reproduce

Expand any content endpoints under Umbraco Delivery API and notice difference with TypedSwagger enabled and disabled.

TypedSwagger enabled

image

image

image

TypedSwagger disabled

image

Expected result / actual result

No response

@bjarnef bjarnef added the bug Something isn't working label Apr 29, 2024
@bjarnef
Copy link
Author

bjarnef commented Apr 29, 2024

@bjarnef bjarnef changed the title TypedSwagger enabled makes expanding content endpoints in Umbraco Delivery API hanging Expanding content endpoints in Umbraco Delivery API is hanging when TypedSwagger is enabled Apr 29, 2024
@lauraneto
Copy link
Contributor

Hi @bjarnef ,

I think the issue you are experiencing is most likely due to swagger-api/swagger-ui#6787, so slightly out of our hands.
Either way, when I have the time, I will double check the generated models to make sure we are not generating more than we should. 🙂

Just to confirm, the actual swagger json loads correctly, and only the UI is slow when you try to expand an operation?

@vsilvar
Copy link
Contributor

vsilvar commented May 1, 2024

Hi @bjarnef
I took a look at the swagger ui bundled with Swashbuckle, and it seems to be quite a bit outdated.
After updating it, performance was much better, so that might be something we can take a look at.

Would you be able to confirm if doing the following solves your issues?

@bjarnef
Copy link
Author

bjarnef commented May 1, 2024

Hi @lauraneto

I was only notable when expanding content endpoints, not media. I guess it is related to many content models including element types, where there often only are a few media types/models.

Swagger UI loaded correctly, but expanding the endpoints made the CPU spike.

However it also seems to have an impact on the Delivery API as the it seemed to shutting down on development environment on Umbraco Cloud. After we disabled TypedSwagger we haven't noticed the same issues.

@kevinstampe
Copy link

kevinstampe commented Aug 28, 2024

It seems like this happens, when the IApiContentResponseModel's oneOf array gets big.

EDIT:
I just found out that swagger performs ALOT better on compatibility mode.
The biggest feature we need from this package, is typedswagger.
But we don't need the polymorphism of it, inheritance is fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants