Closed AbriTj closed 2 years ago
Hi,
SERVICE_IDs are generated from each path OperationId field. According to your ApiDefinition, /payments/policy/{paymentId}, /payments/traffic/{paymentId} and /payments/{paymentId} have the same operationId.
If you can modify the API definition, you should change these operationId as according to the swagger specs they must be unique. If not, you can modify the MainApiVerticle class :
Replace
Router swaggerRouter = SwaggerRouter.swaggerRouter(Router.router(vertx), swagger, vertx.eventBus(), new OperationIdServiceIdResolver());
by
Router swaggerRouter = SwaggerRouter.swaggerRouter(Router.router(vertx), swagger, vertx.eventBus());
As a consequence, DefaultIdResolver will be use. And this resolver compute unique ServiceId based on path.
Hope it helps you. Regards
Thank you! This works perfectly!
Hi,
Thank you for the creating this code generator for Vertx!
I have ran into an issue while generating code with it were it generates conflicting SERVICE_IDs.
Using this API definition the code generator will generate a DefaultApiVerticle with the following SERVICE_IDs:
... final static String CREATEPAYMENT_SERVICE_ID = "createPayment"; final static String CREATEPAYMENT_SERVICE_ID = "createPayment"; final static String CREATEPAYMENT_SERVICE_ID = "createPayment"; ...
I believe these are for the following paths from the API definition:
/payments/policy/{paymentId} /payments/traffic/{paymentId} /payments/{paymentId}
Can the generator be updated to generate unique service IDs in these cases or is there an issue with the API definition or perhaps a workaround?
Kind regards