Skip to main content

no-schema-dollar-id-empty-fragment

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 URI that must not contain a fragment value. This means that an empty fragment (only # appended at the end of the URI) should not be used either.

PropertyValue
EnabledYes
Maximum SeverityWarning
MessageURI provided in $id of Schema Object contains an empty fragment.
CodeOPENAPI3SYNTAX_L141
TypeLinting
Rule SystemSyntax
Broad CategorySchemas
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsopenapi3 openapi syntax linting fragment uri $id id json schema schema

Suggested Fixes

  • Remove the # from the end of the URI.
  • An empty URI fragment is a special case where the fragment identifier consists of only the '#' character with no additional characters following it e.g. https://example.com/index.html#.
  • Ensure that the $id URI does not contain a fragment i.e. remove # or anything after # from the end of the URI.
  • Ensure that $id is a valid URI.

For More Information