You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey there! 😊
I wondered whether it would be possible to overwrite the paths that are currently taken from the decorator to something self-defined..
My problem is that my path is path='/api/exercises/{exercise_id:\d+}/{user_id:(\d+)+\/?}' but that should be kinda internal and I would like to overwrite this with path='/api/exercises/{exercise_id}/{user_id}' so I do not need to show my regex matches to the API user.
From the OpenAPI 2.0 standard:
paths:
/users: <-- this
get:
summary: Returns a list of users.
Currently this does not seem to be possible, atleast not from what I have tried... 😄
I would therefore suggest adding interpretion for the parameter path like this:
"""
---
path:
/api/exercises/{exercise_id}/{user_id}:
get:
tags:
- "My API"
summary: "return an exercise for given student"
description: ""
operationId: "exercise_student_get"
produces:
- "application/json"
responses:
200:
description: successfull return of the exercise
schema:
$ref: "#/definitions/ExerciseStudent"
"""
Would that be possible?
All the best
Chris
The text was updated successfully, but these errors were encountered:
I think when you do my_spec = spec.to_dict() you can easily alter the spec dictionary any way you want.
If you want add interpretation for docstring, that is handled directly by apispec package if I understood correctly what you want.
Hey there! 😊
I wondered whether it would be possible to overwrite the paths that are currently taken from the decorator to something self-defined..
My problem is that my path is
path='/api/exercises/{exercise_id:\d+}/{user_id:(\d+)+\/?}'
but that should be kinda internal and I would like to overwrite this withpath='/api/exercises/{exercise_id}/{user_id}'
so I do not need to show my regex matches to the API user.From the OpenAPI 2.0 standard:
Currently this does not seem to be possible, atleast not from what I have tried... 😄
I would therefore suggest adding interpretion for the parameter
path
like this:Would that be possible?
All the best
Chris
The text was updated successfully, but these errors were encountered: