kogosoftwarellc / open-api

A Monorepo of various packages to power OpenAPI in node
MIT License
892 stars 235 forks source link

allow schema of MediaTypeObject to be a ReferenceObject as well #792

Closed kelvin-thinkbean closed 2 years ago

kelvin-thinkbean commented 2 years ago

Note: This checklist isn't meant to show up on the actual Pull Request (PR). It is added here to make you aware of items our maintainers will look for when reviewing your PR. If your PR is missing any of these items it will be rejected! Please delete this message and the following checklist and replace it with your own message as you see fit.

kelvin-thinkbean commented 2 years ago

Hello, this PR fixes the following:

import { OpenAPIV3_1 } from 'openapi-types'

const requestBody: OpenAPIV3_1.RequestBodyObject = {
  required: true,
  description: 'Login information',
  content: {
    'application/json': {
      schema: {
        $ref: '#/components/schemas/LoginInfoSchema',
      },
    },
  },
}

Error:

image