fastify-swagger-ui icon indicating copy to clipboard operation
fastify-swagger-ui copied to clipboard

Makes all properties/params required, `required: []` option is ignored

Open waveiron opened this issue 7 months ago • 1 comments

Prerequisites

  • [X] I have written a descriptive issue title
  • [X] I have searched existing issues to ensure the bug has not already been reported

Fastify version

^4.26.2

Plugin version

^4.0.0

Node.js version

20.14.0

Operating system

macOS

Operating system version (i.e. 20.04, 11.3, 10)

14.5

Description

For example, in this schema, only "name" is required:

export const args = {
  required: ['name'],
  type: 'object',
  properties: {
    paths: {
      type: ['string', 'null'],
    },
    name: { type: 'string' },
    age: { type: 'number' },
  },
};

but ui requires all properties:

CleanShot 2024-07-04 at 15 35 50@2x

Link to code that reproduces the bug

No response

Expected Behavior

No response

waveiron avatar Jul 04 '24 07:07 waveiron