influxdata / influxdata/openapi
Labels endpoint in cloud.json swagger does not reflect all aspects of current implementation
- Dominant language
- Shell
- Stars
- 18
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
Latest OpenAPI commit
```
commit 3925fc8f650e7256e0a78449eda67817a08464dd (HEAD -> master, origin/master, origin/HEAD)
Author: Reid Hansen <59478953+hansenreid@users.noreply.github.com>
Date: Thu Apr 21 17:20:08 2022 -0500
```
**Observed Behavior**
I'm looking at grace tests for `GET /api/v2/labels`.
The following behavior has been noted using postman.
1) A call to
`/api/v2/labels?orgID=bogus`
Returns a list of labels, with records containing valid orgIDs. So valid OrgIDs can be retrieved using *any* orgID value and that happens as well with a 200 response code. Handling of an empty or invalid orgID query value is not explicitly declared in the cloud.json and so what to assert in terms of verifying the implementation is ambiguous.
2) A call to
`/api/v2/labels?name=myLabel`
works to retrieve a specific label by name. However this is not declared in the swagger document. Since we are using the swagger documents as the unique source of truth to update and expand test coverage, this and similar use cases might be missed.
**Expected Behavior**
That the swagger document, as a contract, should declare and/or describe all possible query params, as well as possible response behaviors to avoid ambiguity and overlooked test/use cases.
Contributor guide
No contributing guide indexed for this repository
Research direction
Open cloud.json and find the GET /api/v2/labels definition. Compare its documented query parameters and response behaviors with the observed orgID and name requests, then update the specification so those cases are represented and unambiguous.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi
- Domain
- api, documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100