FTL
FTL copied to clipboard
Add missing `took` fields to multiple response examples in API spec
What does this PR aim to accomplish?:
This PR enhances the accuracy and consistency of the OpenAPI documentation by ensuring the took field is properly represented across response examples and schema definitions throughout the API specification.
In OpenAPI, when both schema and examples are defined under a response, the examples section takes precedence and overrides any example defined within the schema.
Therefore, in cases where both are present, the took field was explicitly added to the examples section to ensure it is included in the rendered documentation and client generation output.
examples:
| before | |
| after |
How does this PR accomplish the above?:
- Adds the
tookfield (with example value0.003) to multiple response examples, including both success and error cases (unauthorized,forbidden,bad request,database error, etc.). - Updates schema definitions to include a
$reftocommon.yaml#/components/schemas/tookwhere previously missing. - Applies changes across various OpenAPI spec files:
Link documentation PRs if any are needed to support this PR:
N/A
By submitting this pull request, I confirm the following:
- I have read and understood the contributors guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
- I have commented my proposed changes within the code and I have tested my changes.
- I am willing to help maintain this change if there are issues with it later.
- It is compatible with the EUPL 1.2 license
- I have squashed any insignificant commits. (
git rebase) - I have checked that another pull request for this purpose does not exist.
- I have considered, and confirmed that this submission will be valuable to others.
- I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
- I give this submission freely, and claim no ownership to its content.
- [x] I have read the above and my PR is ready for review. Check this box to confirm
The took field should also be be added to many other places, have you checked them as well?
No, I only checked the example used in the info/metrics endpoint.
The change was made specifically to components > examples > metrics in the spec file, which affects only the info/metrics response.
I’ve confirmed that this change does not impact any other APIs directly.
That said, after reviewing other endpoints, I noticed that several of them — e.g. GET /auth — also return a took field but do not include it in their examples.
I’d like to update those as well to ensure consistency across the specification.
Note that there is a dedicated element for this:
$ref: 'common.yaml#/components/schemas/took'
See e.g. action.yaml
@tsutsu3 could you rebase this on development please?
The tests/checks have deployed since this was reviewed and we are currently unable to merge until it is rebased.
Thanks!
@PromoFaux Done.
Could you please also squash down all your commits. I don't think we need a commit per file as there are only very few changes.
@yubiuser Done — squashed and pushed