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 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则

相关内容