ash-project / ash_json_api

The JSON:API extension for the Ash Framework
https://hexdocs.pm/ash_json_api
MIT License
62 stars 42 forks source link

improvement: Serve schema with json content-type #65

Closed gerbal closed 1 year ago

gerbal commented 1 year ago

This PR serves generated json schemas with the content type header "application/schema+json" as specified by the json schema spec.

This change also allows Firefox to pretty print the generated schema, making it more readable for us feeble humans.

Additionally, this PR adds serving the schema from /schema.json ensuring non standard http clients at least have the hinting of the file extension.

Contributor checklist

zachdaniel commented 1 year ago

🚀 Thank you for your contribution! 🚀