Use schema template for 403 errors #1133
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I noticed that https://docs.getodk.org/central-api-entity-management/#updating-an-entity has a 403 example with code and message both set to
pencil
. I imagine that's some fallback when no examples are specified.We have a nice schema template for 403 errors so I went through and used that everywhere.
Some endpoints like the one above had 403s defined with json and json/extended response types. In those cases, I removed the
json/extended
one.Some endpoints redundantly specified an example along with the schema reference which itself specifies the same examples. I removed the redundant ones.
Some endpoints have 403 responses with other response types (e.g. https://docs.getodk.org/central-api-form-management/#draft-form). I think that's also a mistake but didn't want to look too deeply into it for now.
What has been done to verify that this works as intended?
Rendered docs with
make api-docs
, spot checked a few 403s.Why is this the best possible solution? Were any other approaches considered?
Yay for reduction of duplication.
How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?
Docs-only.
Does this change require updates to the API documentation? If so, please update docs/api.yaml as part of this PR.
This does update it.
Before submitting this PR, please make sure you have:
make test
and confirmed all checks still pass OR confirm CircleCI build passes