Redocly / redocly-vs-code

Redocly VS Code extension
35 stars 6 forks source link

Type null in OpenAPI 3.0 #48

Open AlexVarchuk opened 1 year ago

AlexVarchuk commented 1 year ago

What happened? Suggest null in schema->type for OpenApi 3.0

What should have happened instead? Null should not displayed in openapi 3.0 definition

Minimal reproducible OpenAPI snippet

openapi: 3.0.0
servers:
  - url: //petstore.swagger.io/v2
    description: Default server
info:
  description: Test
  version: 1.0.0
  title: Swagger Petstore
  termsOfService: 'http://swagger.io/terms/'
  contact:
    name: API Support
    email: apiteam@swagger.io
    url: https://github.com/Redocly/redoc
  license:
    name: Apache 2.0
    url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
paths:
  /pet:
    post:
      tags:
        - pet
      summary: Add a new pet to the store
      description: Add new pet to the store inventory.
      operationId: addPet
      responses:
        '200':
          description: wrong type suggestions
          content:
            application/json:
              schema:
                type: null <--here is problem

Screenshots

Screenshot 2023-05-18 at 16 58 58