ShogunPanda / fastify-openapi-docs

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

Is this the intended usage of $raw? #7

Closed SomethingSexy closed 1 year ago

SomethingSexy commented 1 year ago

Just want to double check that this is the intended use of $raw?

  schema: {
    params: {
      type: 'object',
      properties: {
        foo: {
          type: 'string',
          description: 'foo',
        },
      },
    },
    response: {
      200: { $raw: 'text/html' },
    },
  },

Looking at the code, it seems like that is what is being expected but I think fastify is failing it first when trying to parse:

FastifyError [Error]: Failed building the serialization schema for GET: /:foo/*, due to error schema is invalid: data/properties/$raw must be object,boolean
ShogunPanda commented 1 year ago

Yes, that's exactly like that. Do you mind providing a repro example so I can investigate further?