question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No way to add description to path parameters

See original GitHub issue

I can’t see any way to add a description to a path parameter. Using the @blp.doc decorator as in:

    @blp.doc(parameters=[{"name": "thing_id", "description": "The ID of the thing"}])

just results in adding another parameter with a duplicate name and only a description. I have a local fix for this in FlaskPlugin where I just scan the existing parameters and update rather than append if I find one with the same name. I can get this into a PR unless you have another way you’d rather approach this?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
congenica-andrewcommented, Nov 16, 2018
1reaction
lafrechcommented, Nov 21, 2018

Good.

I think my rationale here was that:

  • It fails at init, not at runtime, so the error is caught be the developer.
  • Using @blp.doc is a last resort, so it will always be rough along the edges. It provides access to the internals. Let’s not try to do too much checks in there, but rather, let’s provide nice interfaces so that developers don’t need it in the first place.

Ultimately, I’d rather have a nicer way of passing path params doc. I would have liked to avoid yet another decorator, but I’m afraid this is the least awkward solution identified for now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Describing Parameters - Swagger
In OpenAPI 3.0, parameters are defined in the parameters section of an operation or path. To describe a parameter, you specify its name...
Read more >
FastAPI - Add description for path parameter in swagger
You can add description for a specific parameter by using the description argument to the parameter type object: item_id: int = Path(...
Read more >
Path Parameters - FastAPI
You can declare path "parameters" or "variables" with the same syntax used by Python format strings: from fastapi import FastAPI app = FastAPI() ......
Read more >
How to add path parameters to API definition in ... - YouTube
With this video we will learn following in Open API specification 3.0 (OAS):1. How to add path parameters to API definition2. How to...
Read more >
Step 3: Parameters (API reference tutorial) | Documenting APIs
The endpoint also sets off the path parameter ( comment_id ) in a recognizable way in ... There's no right way to document...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found