Overriding Models
Since Wiki's page "Overriding Models" https://github.com/swagger-api/swagger-core/wiki/overriding-models is obsolete, I tried up-to-date technique https://github.com/swagger-api/swagger-core/issues/1274#issuecomment-217916279 : I used the SamplePropertyConverter from https://github.com/swagger-api/swagger-core/blob/master/modules/swagger-core/src/test/java/io/swagger/model/override/SamplePropertyConverter.java and then registered this converter as
ModelConverters.getInstance().addConverter(new SamplePropertyConverter());
But ModelConverters is a signleton which means all the converters will be registered for all swagger applications (I use BeanConfig) in one JVM. Is there any way to bind BeanConfig instance with converters?
Also can anyone tell me what's the difference and what's the point of having two methods in ModelConverter -> resolveProperty and resolve?
Thanks
For what sake at all was that ModelConverters made a static singleton? Why not to have single ModelConverterContext per Reader object, for example?
At the moment we have several JAX-RS applications running in the same container and there is no way to set different ModelConverter-s for different JAX-RS applications since they all share the same ModelConverters.INSTANCE. The only hack is in controlling ModelConverters state and reinitializing it appropriately before the initialization of the particular Swagger instance but it's thread unsafe, obscure and error-prone approach.
Closing this issue as part of our backlog cleanup effort.
This issue is outdated and/or inactive for a long time, and we’re not able to revisit it meaningfully.
If this problem is still relevant, please open a new issue and reference this one for context.
Thank you for your understanding!