I have HTTP request payload structured according to [jsonapi.org](https://jsonapi.org/) guidelines:

```
{
  "data": {
    "type": "employee",
    "attributes": {
      "firstName": "John",
      "lastName": "Doe",
    }
  }
}

```

then I have [OpenApi](https://swagger.io/docs/specification/about/) specification (yaml) of this payload:

```
employee: 
  type: object
  required: [data]
  properties:
    data:
      type: object
      properties:
        type:
          type: string
          enum: [employee]
        attributes: 
          type: object
          required: [firstName, lastName]
          properties:
            firstName:
              type: string
              example: 'John'
            lastName:
              type: string
              example: 'Doe'

```

and what I want is to validate the payload against the specification (from Ruby/Rails).

there exist [openapi3\_parser gem](https://github.com/kevindew/openapi3_parser#validating), but that one seems to be capable only to validate the specification, not the actual payload.

then, there are [jsonapi.org payload deserializers](https://jsonapi.org/implementations/#server-libraries-ruby), but those do not seem to take care about OpenApi formal specification at all.

I use OpenApi to describe the payload becuase I get http API docs for free via Swagger.