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

Expose collection metadata API documentation with Swagger #1015

Merged
merged 19 commits into from
Jul 10, 2023
Merged

Conversation

Ndpnt
Copy link
Member

@Ndpnt Ndpnt commented Jul 4, 2023

No description provided.

Co-authored-by: Matti Schneider <matti@opentermsarchive.org>
@Ndpnt Ndpnt requested a review from MattiSG July 5, 2023 06:54
Copy link
Member

@MattiSG MattiSG left a comment

Choose a reason for hiding this comment

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

I get a blank page if I navigate to http://localhost:3000/api/v1/docs/ after having run npm install and npm start:api.

@MattiSG
Copy link
Member

MattiSG commented Jul 5, 2023

(also, the server does not echo the URL, which would be useful, but that's out of scope I guess)

@Ndpnt
Copy link
Member Author

Ndpnt commented Jul 5, 2023

I get a blank page if I navigate to http://localhost:3000/api/v1/docs/ after having run npm install and npm start:api.

Hum weird 🤔. I have the same error as you with Safari but it works with Chrome and Firefox.

@Ndpnt
Copy link
Member Author

Ndpnt commented Jul 5, 2023

Ok, I found why. It's related to the way browsers handle upgrade-insecure-requests directive.
See helmetjs/helmet#429 (comment):

Chrome and Firefox don't think that localhost needs "upgrading" from HTTP to HTTPS, but Safari does.

@Ndpnt
Copy link
Member Author

Ndpnt commented Jul 5, 2023

I fix the issue on Safari and I also change the Swagger UI url to / instead of /docs to load the Swagger UI docs by default.

@Ndpnt Ndpnt requested a review from MattiSG July 5, 2023 14:37
@Ndpnt
Copy link
Member Author

Ndpnt commented Jul 5, 2023

I tried the deployment on the experimentation server, you can check the Swagger UI here: http://54.37.5.206/api/v1/

Copy link
Member

@MattiSG MattiSG left a comment

Choose a reason for hiding this comment

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

Tested locally:

  • SwaggerUI or OpenAPI based on content type
  • SwaggerUI demo
  • Content load
  • /services
  • /service/Facebook

Everything works perfect!
I'm requesting changes only because of the changelog.

@Ndpnt Ndpnt requested a review from MattiSG July 10, 2023 15:46
Copy link
Member

@MattiSG MattiSG left a comment

Choose a reason for hiding this comment

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

🎉 Perfect!!

Co-authored-by: Matti Schneider <matti@opentermsarchive.org>
@Ndpnt Ndpnt merged commit 1f853c4 into main Jul 10, 2023
@Ndpnt Ndpnt deleted the add-swagger-ui branch July 10, 2023 16:04
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