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 1 year 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

Thanks for reporting!

Can you provide steps to reproduce? We often need a reproducible example, e.g. some code that allows someone else to recreate your problem by just copying and pasting it. If it involves more than a couple of different file, create a new repository on GitHub and add a link to that.

mcollina avatar Jul 06 '24 16:07 mcollina

I don't think this is an issue, because those are path parameters and they are required by definition

sceccotti89 avatar Sep 16 '24 09:09 sceccotti89

Closing it as there was no mvce provider.

Uzlopak avatar Sep 16 '24 09:09 Uzlopak