core icon indicating copy to clipboard operation
core copied to clipboard

`allowEmptyValue` and `allowReserved` are specified for path parameters

Open robjenman opened this issue 8 months ago • 2 comments

API Platform version(s) affected: 4.1.15

Description
Some spec readers will throw an error on allowEmptyValue as its present on a path parameter when the spec says:

This field is valid only for query parameters. Use of this field is NOT RECOMMENDED, and it is likely to be removed in a later revision.

You can't remove the parameter using the decorator either I don't think.

"parameters": [ { "name": "code", "in": "path", "description": "GiftCard identifier", "required": true, "deprecated": false, "allowEmptyValue": false, "schema": { "type": "string" }, "style": "simple", "explode": false, "allowReserved": false } ],

How to reproduce
Appears on all path parameters I've created so far.

robjenman avatar Jun 13 '25 12:06 robjenman

patch welcome to restore to a safe default, probably targetting main if its a bc break

soyuka avatar Jun 13 '25 14:06 soyuka

I've made a pull request, it's the first I've made on this package so apologies if I've missed anything.

I don't love adding logic into the model but I only started using this a week ago so I'm not massively familiar with the codebase yet.

robjenman avatar Jun 17 '25 10:06 robjenman