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

Umbraco Delivery API not valid OpenAPI specification (according to APIM) #17300

Closed
RBerntsen opened this issue Oct 17, 2024 · 4 comments
Closed

Comments

@RBerntsen
Copy link
Contributor

RBerntsen commented Oct 17, 2024

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

14.3.0

Bug summary

When we try to import the JSON specification for the API's from Swagger (out of the box on v14) into Azure API Management, we get two errors:

  1. The security scheme "Backoffice User" is invalid (cannot have a space)
    image

  2. Four operations with duplicate signatures:
    image

This is due to the fact that we have four pairs of endpoints that are somewhat equal, only difference is the name of the parameter, i.e. "path" and "id" are both of type string.

The endpoints are these four pairs:

/umbraco/delivery/api/v1/content/item/{path}
/umbraco/delivery/api/v1/content/item/{id}

/umbraco/delivery/api/v2/content/item/{path}
/umbraco/delivery/api/v2/content/item/{id}

/umbraco/delivery/api/v1/media/item/{path}
/umbraco/delivery/api/v1/media/item/{id}

/umbraco/delivery/api/v2/media/item/{path}
/umbraco/delivery/api/v2/media/item/{id}

I think it would be relatively easy to rename the scheme for the "Backoffice User" to e.g. "BackofficeUser" as that looks to just be a const string:
image

I'm unsure how exactly to handle the issue with the duplicate endpoints, as we would probably like both to be displayed in Swagger?

I have encountered similar issues on v12 and v13 as well.

Specifics

See above

Steps to reproduce

Navigate to your APIM instance in Azure.
Select "APIs" and select "OpenAPI" under the "Create from definition".

image

From here you can upload the JSON file that was generated for the Swagger documentation.

When doing this you will first be presented with the error for the security scheme. After fixing that you will be presented with the issue for the duplicate endpoints.

Expected result / actual result

I would expect that the JSON file contained a valid OpenAPI specification that could be imported into APIM without modifications


This item has been added to our backlog AB#45094

Copy link

Hi there @RBerntsen!

Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.

We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.

  • We'll assess whether this issue relates to something that has already been fixed in a later version of the release that it has been raised for.
  • If it's a bug, is it related to a release that we are actively supporting or is it related to a release that's in the end-of-life or security-only phase?
  • We'll replicate the issue to ensure that the problem is as described.
  • We'll decide whether the behavior is an issue or if the behavior is intended.

We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

@iOvergaard iOvergaard added state/sprint-candidate We're trying to get this in a sprint at HQ in the next few weeks area/backend affected/v14 labels Oct 17, 2024
@iOvergaard
Copy link
Contributor

Hi @RBerntsen, thanks for the report. We will take a look at it in an upcoming sprint!

@kjac
Copy link
Contributor

kjac commented Oct 31, 2024

Hi @RBerntsen,

Thanks for reporting! The Delivery API OpenAPI spec should not have the Management API security scheme to begin with 🙈

#17401 fixes the validation errors of the spec.

Do note that the "duplicate signatures" issue you're encountering is not caused by an invalid OpenAPI spec. The spec has explicit and unique operation IDs for each endpoint 👍

@kjac kjac added state/in-sprint We've committed to work on this during the sprint indicated in the milestone and removed state/sprint-candidate We're trying to get this in a sprint at HQ in the next few weeks labels Oct 31, 2024
@elit0451
Copy link
Member

elit0451 commented Nov 4, 2024

Fixed in #17401

@elit0451 elit0451 closed this as completed Nov 4, 2024
@elit0451 elit0451 added release/15.0.0 and removed state/in-sprint We've committed to work on this during the sprint indicated in the milestone area/backend affected/v14 labels Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants