Closed oussamaABID closed 4 years ago
Hi, the prefix option is to be used for internal API prefixes.
In your case, you will have to use a custom function for the uiIndex option to handle your use case. See https://github.com/feathersjs-ecosystem/feathers-swagger/blob/master/lib/index.js#L39 for the default handling.
hi mairu, tanks for replay. finaly i add just mymicroservice in docsPath option like this
swagger({
docsPath: '/mymicroservice/swagger-ui',
uiIndex: (process.env.ENABLE_UI_SWAGGER=== 'true'),
openApiVersion: 3,
the probleme when i use swagger UI to try in out my service . i dont have mymicroservice in url.
curl -X POST "http://localhost:3030/myService?param1=b¶m2=b"
It s possible to custumise url to add mymicroservice in ui try in out ?
curl -X POST "http://localhost:3030/mymicroservice/myService?param1=b¶m2=b" -H "accept: */*" -H "Content-Type: application/json"
Maybe getOperationArgs ?
thanks :)
There is the servers option of the openApi Specification -> https://swagger.io/docs/specification/api-host-and-base-path/ . There you should be able to configure the server to your needs.
You would have to set this in the specs options of the initialization.
thanks mairu you save my day 🚀
hi , My swagger is here :
http://localhost:8080/swagger-ui/?url=/swagger-ui
but when i use my gateway to call micro service.. my url to get UI is different so she not working :
http://localhost:8080/mymicroservice/swagger-ui/?url=/swagger-ui
Spring gateway :/
to get my swagger UI. i need add mymicroservice in path like this
http://localhost:8080/mymicroservice/swagger-ui/?url=/mymicroservice/swagger-ui
After that i need add mymicroservice in path when i call each app service
localhost:8080/mymicroservice/myservice
how i can do that ?
Thanks
i try prefix option but is not working