Currently:
src/Swagger/Serializer/DocumentationNormalizer.php:553
if (null !== $publicClass) {
$keyPrefix .= ':'.md5($publicClass);
}
How about allowing to specify generated struct name? Think it should be introduced before releasing 2.4 because it leads to produce weirdly-named classes when — for example — swagger-codegen is being used.
We definitely need to add a class to generate this name :+1:
If you point me, what do you need from architecture aspect, may be it will be possible for me to create a PR with this.
Check how the NameConverter works, I think it'd be almost the same (mb we can reuse it, not sure).
@er1z Would something like this work: https://github.com/api-platform/core/pull/2487
@ragboyjr yup, it should work but your solution disallows to put name on generated structure. We need to create (that's proposal) an adequate key under swagger_context configuration structure and use your code as a fallback. I'll look into in a couple of days because I need this. :)
That fix is more temporary. Long term, I think all input classes should be resources and we could then use the short name in swagger. This will then allow us to easily customize that value
Any updates?
Currently vendor/api-platform/core/src/Swagger/Serializer/DocumentationNormalizer.php:305 forces $serializerContext to be null so I cannot specify the whole name. Also, buildDefinitionName is private so decorating this will take a massive amount of code.
Wasn't this fixed by https://github.com/api-platform/core/pull/3231 ?
@soyuka
No, #3231 does not allow customizing name.
Most helpful comment
That fix is more temporary. Long term, I think all input classes should be resources and we could then use the short name in swagger. This will then allow us to easily customize that value