Models

How schemas become named model types in the generated SDKs.

Rule Default Summary
Model/Detached warn A configured model does not resolve to a compiled schema.
Model/DuplicateName warn Two configured models claim the same generated model name.
Model/Recommended info A schema referenced from multiple places is not declared as a model.
Model/TargetReservedName info A target does not give a model its own name, because the target reserves that name.

Model/Detached

A configured model does not resolve to a compiled schema.

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

When it fires

A configured model does not resolve to any compiled schema, so it detaches from the resource that declared it.

Changing or silencing it

Each finding's suppression key is the configured model 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": {
      "Model/Detached": "info"
    },
    "ignored": {
      "Model/Detached": "<suppression key>"
    }
  }
}

Model/DuplicateName

Two configured models claim the same generated model name.

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

When it fires

Two configured models backed by different schemas claim the same generated name. The first claimant keeps the name and the rest are renamed, so the SDK ships a numbered type nobody chose.

Changing or silencing it

Each finding's suppression key is the generated model 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": {
      "Model/DuplicateName": "info"
    },
    "ignored": {
      "Model/DuplicateName": "<suppression key>"
    }
  }
}

Model/Recommended

A schema referenced from multiple places is not declared as a model.

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

When it fires

A component schema is referenced from three or more places but is not declared as a model, so the type is re-expanded inline at every use.

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": {
      "Model/Recommended": "off"
    },
    "ignored": {
      "Model/Recommended": "<suppression key>"
    }
  }
}

Model/TargetReservedName

A target does not give a model its own name, because the target reserves that name.

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

When it fires

A target reserves the model's name, so it declares the model under another one: Java and Kotlin rename a model that would shadow an implicit import (Error becomes ErrorModel), and Ruby leaves out the gem-root alias for a name such as Error or Client.

Changing or silencing it

Each finding's suppression key is <target>:<Name>, such as kotlin:Error.

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": {
      "Model/TargetReservedName": "off"
    },
    "ignored": {
      "Model/TargetReservedName": "<suppression key>"
    }
  }
}

See also

What did you think of this content?