ShogunPanda / fastify-openapi-docs

A simple plugin for Fastify that generates OpenAPI spec automatically.
ISC License
27 stars 5 forks source link

headers description comes from the schema not the header property #10

Closed krichards closed 1 year ago

krichards commented 1 year ago

Given a header schema such as this

const HeadersSchema = {
  type: 'object',
  properties: {
    'x-app-id': {type: 'string',   description: 'application identifier'}
  },
  required: ['x-app-id']
} as const;

I would expect the description to come through on the header on docs, but it doesn't. Currently it would appear that I need to do this

const HeadersSchema = {
  type: 'object',
  properties: {
    'x-app-id': {type: 'string'}
  },
  required: ['x-app-id'],
  description: 'application identifier'
} as const;

which is obviously wrong if I want to have checks on different headers.

ShogunPanda commented 1 year ago

You are right. Thanks for reporting this. I fixed this in release 2.2.1