mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 23:59:26 +03:00
883d7b6c89
* Apply `enum` from Choice Constraints to Items When Choice is Multiple Otherwise JSON schema like this is generated: ``` "property": { "type": "array", "enum": ["one", "two", "three"], "items": { "type": "string" } } ``` With this change, however, this schema is generated: ``` "property": { "type": "array", "items": { "type": "string", "enum": ["one", "two", "three"] } } ``` A possible downside here is that the symfony constraint stuff happens before types are figured out from PHPDoc. So it's _possible_ to end up with something that won't validated. Take something like this: ``` /** * @Assert\Choice(multiple=true, choices={"..."}) * @var string */ ``` This would generate: ``` "property": { "type": "string", "items": { "enum": ["..."] } } ``` * Fix CS * cs * more cs * fix tests Co-authored-by: Guilhem Niot <guilhem@gniot.fr>