normalized-schema-dollar-id-uri
Overview
This rule belongs to the openapi-v3-syntax-linting ruleset and states that:
The value of $id in a Schema Object must be a valid normalized URI.
| Property | Value |
|---|---|
| Enabled | Yes |
| Maximum Severity | Warning |
| Message | URI provided in $id of the Schema Object is not normalized. |
| Code | OPENAPI3SYNTAX_L142 |
| Type | Linting |
| Rule System | Syntax |
| Broad Category | Schemas |
| Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
| Tags | openapi3 openapi syntax linting uri $id id json schema schema |
Suggested Fixes
- URI normalizations include case normalization, percent-encoding normalization, path segment normalization, scheme-based normalization, protocol-based normalization etc.
- The hexadecimal digits within a percent-encoding triplet (e.g.,
%3aversus%3A) are case-insensitive and therefore should be normalized to use uppercase letters for the digits A-F. - The scheme and host are case-insensitive and therefore should be normalized to lowercase e.g. the URI <HTTP://www.EXAMPLE.com/> is equivalent to <http://www.example.com/>.
- Convert an empty path to
/path e.g.http://example.comandhttp://example.com/are equivalent. - Dot-segments
.and..in the path component of the URI should be removed by applying the remove_dot_segments algorithm.
For More Information
- https://datatracker.ietf.org/doc/html/rfc3986#section-6
- https://datatracker.ietf.org/doc/html/rfc3986
- https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-00#section-8.2.1
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#schema-object
- https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2
- https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2.1
- https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2.2
- https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2.3
- https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.3
- https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.4
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#openapi-specification
- https://docs.apimatic.io/rulesets/overview/