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

Update OpenAPI specification #321

Merged
merged 1 commit into from
Aug 23, 2024
Merged

Update OpenAPI specification #321

merged 1 commit into from
Aug 23, 2024

Conversation

csutter
Copy link
Contributor

@csutter csutter commented Aug 23, 2024

This brings our OpenAPI specification in line with the current state of the API endpoints for search, and adds the autocomplete endpoint.

Live demo: https://generator.swagger.io/?url=https://raw.githubusercontent.com/alphagov/search-api-v2/549b3611f2d0ed37bbc56a969e422cbbbaddca63/docs/openapi/specification.yml

Copy link
Member

@kevindew kevindew left a comment

Choose a reason for hiding this comment

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

Looks really good, just a couple of minor things.

@@ -1,35 +1,296 @@
openapi: '3.0.0'
info:
title: GOV.UK Search API
title: GOV.UK Search API v2
version: 2.0.0-alpha

paths:
/search:
Copy link
Member

Choose a reason for hiding this comment

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

Should this be /search.json (I notice it's inconsistent with the auto complete one)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually it can just be /search (the .json is just a Railsism after all and the request content type is what matters - not to mention even that is ignored by Search API v2 which will always return JSON regardless of what you ask for 😂 )

Copy link
Member

Choose a reason for hiding this comment

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

Great - I saw you amended autocomplete instead. Looks good.


This is used for analytics purposes to uniquely identify the search request.
example: >-
tgHwtQoLCLTQobYGEOeqt2wSJDY2Y2ZhYTBhLTAwMDAtMjIwZi04MGEwLWQ0ZjU0N2YwMjMxNCIHR0VORVJJQyp4t5KuMPn2sy3Usp0VmNa3LeuCsS2t-LMtmd6oL87mtS-0kq4w5-2ILdHmtS_C8J4Vo4CXIre3jC3ogrEtlt6oL6r4sy2b1rct3o-aIqvEii389rMtjr6dFYCymiKgibMtx8vzF4OymiKjibMt5O2ILduPmiKuxIot
Copy link
Member

Choose a reason for hiding this comment

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

I trust that this is a fake token 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is indeed 😁 But in some alternate universe it may relate to something...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

TBF I might make it more obviously fake so that people/cyber scanning tools don't get confused or worried

docs/openapi/specification.yml Outdated Show resolved Hide resolved
This brings our OpenAPI specification in line with the current state of
the API endpoints for search, and adds the autocomplete endpoint.
@csutter csutter merged commit 6c9177d into main Aug 23, 2024
8 checks passed
@csutter csutter deleted the docs branch August 23, 2024 16:03
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