You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
newPost(
uriTemplate: '/things',
processor: ThingCreateProcessor::class,
input: \App\Domain\YourDomain\Model\Input\ThingCreate::class,
output: \App\Domain\YourDomain\Model\Output\ThingCreate::class,
openapi: newOperation(
summary: 'Create a new shiny thing'
),
),
Possible Solution
Take TYPE_(INPUT|OUTPUT) into consideration when doing "class-to-name"
Let the Factory throw when this occurs AND add some callable/interface to the factory's constructor that is responsable for "class-to-name" (and reference to that in the exception thrown). This would be a BC break I guess....
Edit: For the latter, DefinitionNameFactory seems already in place. One could decorate that to archieve this. So my request would be: "Can we let the Factory notify the developer in case the "overwrite" take place?"
API Platform version(s) affected: 4.2.0
Description
OpenAPI spec incomplete when
inputandoutputhave the same classname ("shortname").Both
inputandoutputwill produce the same$ref, causing them to override each other.As a result, in the OpenAPI UI, the output data/Dto is presented as "Request body" for the input.
How to reproduce
Model structure:
API resource:
Possible Solution
TYPE_(INPUT|OUTPUT)into consideration when doing "class-to-name"DefinitionNameFactoryseems already in place. One could decorate that to archieve this. So my request would be: "Can we let the Factory notify the developer in case the "overwrite" take place?"Additional Context