Skip to content

Path parameters support in swagger #369

Closed Answered by tarsil
saurabhgharatpara asked this question in Q&A
Discussion options

You must be logged in to vote

@saurabhgharatpara Yes, I mentioned that before

from esmerald import Esmerald, get, JSONResponse

# For handler

@get("/pet/{petid}")
async def get_pet(petid: str) -> JSONResponse:
    # add your logic here to return

# And then in the Gateway, you simply do:
Gateway(handler=get_pet)

Every path parameter and the type must be declared in the function handler in order to make sure it will be recognised.

Replies: 7 comments 45 replies

Comment options

You must be logged in to vote
10 replies
@saurabhgharatpara
Comment options

@tarsil
Comment options

@saurabhgharatpara
Comment options

@tarsil
Comment options

Answer selected by saurabhgharatpara
@saurabhgharatpara
Comment options

@tarsil
Comment options

@saurabhgharatpara
Comment options

@tarsil
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
17 replies
@tarsil
Comment options

@tarsil
Comment options

@tarsil
Comment options

@saurabhgharatpara
Comment options

@tarsil
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
10 replies
@saurabhgharatpara
Comment options

@saurabhgharatpara
Comment options

@tarsil
Comment options

@saurabhgharatpara
Comment options

@tarsil
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
8 replies
@tarsil
Comment options

@saurabhgharatpara
Comment options

@tarsil
Comment options

@saurabhgharatpara
Comment options

@tarsil
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants