valid-schema-content-encoding
Overview
This rule belongs to the openapi-v3-standards-validation
ruleset and states that:
Information about how a string value is encoded is provided using the Schema Object contentEncoding
property which must be a valid encoding value from RFC 4648 or RFC 2045: base64url
, base64
, base32
, base32hex
, base16
, hex
, 7bit
, 8bit
, binary
, quoted-printable
, ietf-token
, x-token
. These values are compared in a case-insensitive manner.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Warning |
Message | The value provided for contentEncoding in the Schema Object is invalid/unrecognized. |
Code | OPENAPI3STANDARDS_V342 |
Type | Validation |
Rule System | Semantic |
Broad Category | Schemas |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | openapi3 openapi standards semantic validation encoding content schema base64 base32 base16 quoted printable json schema |
Suggested Fixes
- Ensure that the value of the
contentEncoding
property is one of the following: base64url, base64, base32, base32hex, base16, hex, 7bit, 8bit, binary, quoted-printable, ietf-token, x-token - Encoding values are compared in a case-insensitive manner.
For More Information
- https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-00#section-8.3
- https://datatracker.ietf.org/doc/html/rfc4648
- https://datatracker.ietf.org/doc/html/rfc2045
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#schema-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#openapi-specification
- https://docs.apimatic.io/rulesets/overview/