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.

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달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠