Hot to remove/move general scope prefix from paths #339
Answered by mbuhot
ycherniavskyi asked this question in Q&A
-
| For example, I get the next routes: #... scope "/api", AppWeb, as: :api do pipe_through :api scope "/v1", Api.V1, as: :v1 do get "/open-api", OpenApiSpex.Plug.RenderSpec, [], alias: false scope "/otp" do post "/request", OtpController, :request post "/verify", OtpController, :verify end end end #...and in result I get the next OpenAPI JSON: { ... "paths": { "/api/v1/otp/request": { ... }, "/api/v1/otp/verify": { ... } }, ... "servers": [ { "url": "http://localhost:4000", "variables": {} } ], ... }Is it possible to somehow move the general scope prefix If it is not possible automatically then, so maybe is it possible to remove the general scope prefix |
Beta Was this translation helpful? Give feedback.
Answered by mbuhot Mar 29, 2021
Replies: 1 comment 1 reply
-
| Hi @ycherniavskyi, you should be able to adjust the paths by transforming the output of Something like: |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by ycherniavskyi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Hi @ycherniavskyi, you should be able to adjust the paths by transforming the output of
Paths.from_router/1when you build the%OpenApi{}struct.Something like: