Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EES-5664 Update public API docs to handle multiple API versions #5397

Merged
merged 6 commits into from
Nov 22, 2024
Merged

Conversation

ntsim
Copy link
Collaborator

@ntsim ntsim commented Nov 17, 2024

⚠️ Depends on #5396

This PR updates the public API docs to handle multiple API versions (in the future). Previously, the API reference docs were only generated from a single OpenAPI document, meaning we couldn't publish docs for multiple API versions.

We can now generate API reference docs from any openapi-v*.json documents that are placed in the source directory.

Config and environment changes

  • Added .env support in API docs project. This is for local development to make it easier to change and persist environment variable changes (if required).
  • Added api_url config option (or TECH_DOCS_API_URL env variable) for API docs. This allows us to build for different environments in the build pipeline. We now default to http://localhost:5050 for local development.

Other changes

  • Changed server URL for OpenAPI doc to /. This makes the default document agnostic of the environment.
  • Fixed incorrect example for DataSetLatestVersionViewModel.GeographicLevels property


# OpenAPI documents

The explore education statistics (EES) API is fully compliant with the [OpenAPI 3.0 specification](https://swagger.io/specification/v3/).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would suggest capitalising the first "e"?

Copy link
Collaborator Author

@ntsim ntsim Nov 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would make intuitive sense, but the service name casing was decided by Cam.

I did argue the point that it's not particularly nice and potentially could be unclear to users, but he was pretty insistent.

Consequently, the convention is:

  • Start of sentence - use 'Explore'
  • Mid-sentence - use 'explore'

I think at some point he'll want us to go through the rest of the service and change it across the board as well.


# <%= title %>

This section lists all the endpoints available on the explore education statistics (EES) <%= version %> API.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capitalise the first "e" again?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment: #5397 (comment)


# <%= title %>

This section contains the reference documentation for the explore education statistics (EES)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capitalise?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment: #5397 (comment)

if api_docs_path.nil?
return resources
end
if path != "source/openapi-#{version}.json"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice bit of sanity checking :)

end
base_path = "/reference-#{version}"

resources << Middleman::Sitemap::ProxyResource.new(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just going to trust that this works! Kudos on working all of this out!

Base automatically changed from ees-5663 to dev November 22, 2024 11:40
@ntsim ntsim merged commit d1935df into dev Nov 22, 2024
8 checks passed
@ntsim ntsim deleted the ees-5664 branch November 22, 2024 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants