Skip to content

Fix Open API spec #100

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Fix Open API spec #100

wants to merge 1 commit into from

Conversation

RingoDev
Copy link
Contributor

Hey @oej this is a fix up of some of the broken pieces of @vpetersson's WIP PR.

Discussed here: https://cyclonedx.slack.com/archives/C04LR6R9T8E/p1739278644285349

@RingoDev RingoDev requested review from oej and madpah as code owners February 17, 2025 15:10
@RingoDev
Copy link
Contributor Author

RingoDev commented Feb 17, 2025

I removed the Security Requirement we had on each operation as this is set globally and the same for all endpoints (at the moment)
I also got rid of the basicAuth security scheme definition and global requirement.

Signed-off-by: RingoDev <[email protected]>
@RingoDev
Copy link
Contributor Author

Last point to note: To fix the problems with the spec I had to make an assumption about how the "Product Index" (GET /product) should be paginated.
It is now wrapped in the way that the endpoint returns an object with pagination attributes at top level as well as a content attribute that contains the list of products.

"paginated_product_list": {
    "type": "object",
    "allOf": [
        {
            "$ref": "#/components/schemas/type_pagination_details"
        },
        {
            "type": "object",
            "properties": {
                "content": {
                    "type": "array",
                    "items": {
                        "$ref": "#/components/schemas/tea_product"
                    }
                }
            }
        }
    ]
}

Copy link
Contributor

@vpetersson vpetersson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants