NelmioApiDocBundle icon indicating copy to clipboard operation
NelmioApiDocBundle copied to clipboard

Invalid spec generated on OpenApi 3.1.0 with symfony constraints

Open DjordyKoert opened this issue 1 year ago • 0 comments

I would have expected the underlying swagger-php to automatically transform the generated schema to the correct notation https://github.com/zircote/swagger-php/pull/1503. This does not seem to be the case when Symfony constraints are used.

For example when using #[Assert\GreaterThan(0)] on a model property with nelmio config:

'documentation' => [
    'openapi' => '3.1.0',
],

An incorrect spec will be generated:

"exampleProperty": {
    "type": "integer",
    "minimum": 0,
    "exclusiveMinimum": true
},

DjordyKoert avatar Jan 03 '24 10:01 DjordyKoert