Can the quality of the generated openapi specs be increased and can you provide a download of a JSON schema for the whole API?

0

Hi, we are using the apigateway JSONSchema to define our lambda endpoints. It works fine, even with multiple types including null. The OAS30 doesnt support multiple types and/or nullable attributes. example:

someField: {
      type: [JsonSchemaType.NUMBER, JsonSchemaType.STRING, JsonSchemaType.NULL],
},

should output something like

someField: {
    "oneOf": [
        {
        "type": "number",
        },
        {
        "type": "string"
        }
    ],
   nullable: true
}

but it outputs:

someField: {
      "type": "object"
},

This is annoying because I need to provide specs to consumers of my api, and now I have to do some awkward post-processing.

My two feature requests and one nice to have:

Feature request 1: support nullable and multiple types in the exports (it seems de validation does work as expected)

Feature request 2: support export the whole API as JsonSchema: I'd like to export the whole API as JsonSchema, that would probably output the multiple types as is. Then I can generate my own openApi spec file (if null is in types array, add nullable: true etc).

Nice to have: export OAS31 format but that's a question that has been asked already.

Rienk
已提問 6 個月前檢視次數 164 次
1 個回答
0

Hello,

To overcome the issue of nullable attributes, I understand that you have to do some manual post-processing w.r.t. the Open API definition as below before importing the API:

Eg: --------- Open API --------- "array_or_null" : { "oneOf" : [ {"type" : "null"}, { "type" : "integer" } ] }

We understand that the lack of the features you mentioned is causing inconvenience. Please note that the internal team is aware of this issue (both the above mentioned issues) and there is a feature request with the team. Hence, I have added your voice to the internal request by adding this reach-out as evidence. Kindly note here that, regarding these changes, Premium Support Engineers do not have visibility into the progress or roadmap and thus I am afraid I cannot provide you with an ETA for the same. I would request you to keep an eye on the what's new page or the AWS Blogs [1] as all new feature requests and enhancements are posted there.

[1] https://aws.amazon.com/new/

AWS
支援工程師
已回答 6 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南