Schemas

Schemas whose shape gives the generated types less to work with than intended.

Rule Default Summary
Schema/DeprecatedWithoutMessage info A schema is deprecated without any description explaining the replacement.
Schema/EnumHasOneMember info An enum schema declares exactly one member.
Schema/NonFiniteValue warn A schema lists a non-finite enum or const value, which is dropped.
Schema/ObjectHasNoProperties info An object schema declares no properties or other shape.
Schema/RecursiveMustBeModel warn A recursive schema has no declared model and renders as an opaque type.
Schema/UnknownType info A schema declares an unrecognized type that falls back to string.

Schema/DeprecatedWithoutMessage

A schema is deprecated without any description explaining the replacement.

Default severity Fix lives in
info Your API description (document)

When it fires

A schema is marked deprecated with no description, so SDK users see a deprecation with no hint about the replacement.

Changing or silencing it

Each finding's suppression key is the schema pointer.

Re-grade the rule with diagnostics.rules, or silence findings with diagnostics.ignored, matching their suppression key exactly or with * as a wildcard:

{
  "diagnostics": {
    "rules": {
      "Schema/DeprecatedWithoutMessage": "off"
    },
    "ignored": {
      "Schema/DeprecatedWithoutMessage": "<suppression key>"
    }
  }
}

Schema/EnumHasOneMember

An enum schema declares exactly one member.

Default severity Fix lives in
info Your API description (document)

When it fires

An enum declares exactly one member — usually a constant, or a member list that lost entries somewhere upstream.

Changing or silencing it

Each finding's suppression key is the schema pointer.

Re-grade the rule with diagnostics.rules, or silence findings with diagnostics.ignored, matching their suppression key exactly or with * as a wildcard:

{
  "diagnostics": {
    "rules": {
      "Schema/EnumHasOneMember": "off"
    },
    "ignored": {
      "Schema/EnumHasOneMember": "<suppression key>"
    }
  }
}

Schema/NonFiniteValue

A schema lists a non-finite enum or const value, which is dropped.

Default severity Fix lives in
warn Your API description (document)

When it fires

A schema lists Infinity, -Infinity or NaN (YAML's .inf, -.inf, .nan) in its enum or as its const. No SDK can spell them, so they are dropped; an enum left empty, or such a const, becomes the schema's declared type, or number when it declares none.

Changing or silencing it

Each finding's suppression key is the schema name.

Re-grade the rule with diagnostics.rules, or silence findings with diagnostics.ignored, matching their suppression key exactly or with * as a wildcard:

{
  "diagnostics": {
    "rules": {
      "Schema/NonFiniteValue": "info"
    },
    "ignored": {
      "Schema/NonFiniteValue": "<suppression key>"
    }
  }
}

Schema/ObjectHasNoProperties

An object schema declares no properties or other shape.

Default severity Fix lives in
info Your API description (document)

When it fires

An object schema declares no properties and no other source of shape, so it becomes an untyped value everywhere.

Changing or silencing it

Each finding's suppression key is the schema pointer.

Re-grade the rule with diagnostics.rules, or silence findings with diagnostics.ignored, matching their suppression key exactly or with * as a wildcard:

{
  "diagnostics": {
    "rules": {
      "Schema/ObjectHasNoProperties": "off"
    },
    "ignored": {
      "Schema/ObjectHasNoProperties": "<suppression key>"
    }
  }
}

Schema/RecursiveMustBeModel

A recursive schema has no declared model and renders as an opaque type.

Default severity Fix lives in
warn Your SDK configuration (config)

When it fires

A schema takes part in a $ref cycle but is not declared as a model. Cutting the cycle renders the back-reference opaquely, so a declared model is the only way users get a real type at the recursion point.

Changing or silencing it

Each finding's suppression key is the component name.

Re-grade the rule with diagnostics.rules, or silence findings with diagnostics.ignored, matching their suppression key exactly or with * as a wildcard:

{
  "diagnostics": {
    "rules": {
      "Schema/RecursiveMustBeModel": "info"
    },
    "ignored": {
      "Schema/RecursiveMustBeModel": "<suppression key>"
    }
  }
}

Schema/UnknownType

A schema declares an unrecognized type that falls back to string.

Default severity Fix lives in
info Your API description (document)

When it fires

A schema states a type the generator does not recognize, and the value falls back to a string. An absent type is exempt.

Changing or silencing it

Each finding's suppression key is the schema name.

Re-grade the rule with diagnostics.rules, or silence findings with diagnostics.ignored, matching their suppression key exactly or with * as a wildcard:

{
  "diagnostics": {
    "rules": {
      "Schema/UnknownType": "off"
    },
    "ignored": {
      "Schema/UnknownType": "<suppression key>"
    }
  }
}

See also

What did you think of this content?