cloudformation-cli icon indicating copy to clipboard operation
cloudformation-cli copied to clipboard

Export a REST API from API Gateway as OpenAPI3.0 does not support type null in models

Open zibi94 opened this issue 3 years ago • 0 comments

from model (jsonschema):

            "value":{
                "oneOf":[
                    {
                        "type":"string"
                    },
                    {
                        "type":"integer"
                    },
                    {
                        "$ref":"https://apigateway.amazonaws.com/restapis/{RestApiId}/models/Emails"
                    },
                    {
                        "$ref":"https://apigateway.amazonaws.com/restapis/{RestApiId}/models/Phones"
                    },
                    {
                        "type":"integer"
                    },
                    {
                        "type":"null"
                    }
                ]
            } 

generated OpenAPI3.0:

            "value": {
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                },
                {
                  "$ref": "#/components/schemas/Emails"
                },
                {
                  "$ref": "#/components/schemas/Phones"
                },
                null
              ]
            }

if the model includes:

  "properties": {
       "name": {
           "description": "Tenant Name",
           "type": ["string","null"]
       }
   }

documentation for this scheme is not generated at all

zibi94 avatar Aug 10 '21 14:08 zibi94