You have two options to validate your OOAPI endpoint:
Validation using SURFeduhub
If your endpoint is connected to (the test environment of) SURFeduhub, you can use the built-in validation functionality to validate your responses. To use the functionality, you can make the following HTTP request:
GET https://gateway.test.surfeduhub.nl/<OOAPI-path> Authorization: Basic <your authorization> Accept: application/json;version=5 X-Route: endpoint=<the identifier of your endpoint> X-Validate-Response: true
Make sure to include the Authorization, X-Route and X-Validate-Response HTTP headers, as these are all necessary for the request to work as intended.
This request will trigger SURFeduhub to forward the request to your endpoint and validate the response. If the response is compliant with the OOAPI specification, it will be returned 'as-is'. Otherwise, you will receive a response explaining why your response was not valid.
Manual validation using the OOAPI specification
You can also manually validate your OOAPI endpoint, using one of the many tools compatible with the OpenAPI standard for validation. The general steps for this are:
Acquire the specification. This can be done in two ways:
A) The OOAPI working group regularly releases a bundled version of the specification on Github: https://github.com/open-education-api/specification/releases.
Or
B) Download and bundle the specification yourself. This will always get you the most recent version of the specification, but requires some command line knowledge:
Clone the OOAPI repository:
git clone https://github.com/open-education-api/specification.gitcd specification/v5- Optionally merge the yaml files into a single file using the following command:
npx @redocly/cli bundle spec.yaml -d -o bundle.yaml
You need node for this to work.
Once you have the specification, use your preferred tool in to validate your responses. To find tools capable of validating OpenAPI specifications, check here: https://openapi.tools/#data-validators