transparency-exchange-api icon indicating copy to clipboard operation
transparency-exchange-api copied to clipboard

Fix Open API spec

Open RingoDev opened this issue 10 months ago • 3 comments

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 avatar Feb 17 '25 15:02 RingoDev

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.

RingoDev avatar Feb 17 '25 15:02 RingoDev

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"
                    }
                }
            }
        }
    ]
}

RingoDev avatar Feb 17 '25 15:02 RingoDev

@oej,

Since #119 does not have validation errors, should we close this PR and merge that one?

ppkarwasz avatar Apr 29 '25 21:04 ppkarwasz