pb33f/libopenapi-validator

Support JSON:API content-type

zekth opened this issue · 4 comments

zekth commented

Currently as stated it supports only JSON:

if strings.ToLower(contentType) == helpers.JSONContentType {

We should support https://jsonapi.org/ format like application/vnd.api+json

This is out of scope for libopenapi. I want to keep the library tightly focused on OpenAPI and not mix in the different concepts and foundations of JSON:API

zekth commented

It is part of specification: https://swagger.io/specification/

Media type definitions are spread across several resources. The media type definitions SHOULD be in compliance with RFC6838.

Some examples of possible media type definitions:

  text/plain; charset=utf-8
  application/json
  application/vnd.github+json
  application/vnd.github.v3+json
  application/vnd.github.v3.raw+json
  application/vnd.github.v3.text+json
  application/vnd.github.v3.html+json
  application/vnd.github.v3.full+json
  application/vnd.github.v3.diff
  application/vnd.github.v3.patch

See: https://www.rfc-editor.org/rfc/rfc6838#section-4.2.8

Oh I see what you mean, you just want support for those mime types, vs actually supporting validation of different schema types outside of JSON schema.

I would avoid looking at the code you see today, as the code that will make it into the final cut, a lot of this is me exploring out concepts and patterns.

Try v0.0.1 and open any issues you may find.