Document
References and schema constructs in the API description that cannot be followed as written.
| Rule | Default | Summary |
|---|---|---|
Document/ContradictoryPropertyAccess |
warn |
A property is marked both readOnly and writeOnly, so it should be sent in neither direction. |
Document/DiscriminatorMappingContradicted |
warn |
A discriminator maps a value to a variant whose schema pins the discriminator to a different value. |
Document/DiscriminatorPropertyAbsent |
warn |
A discriminator maps several values to a variant that does not declare the discriminator property. |
Document/ExtensionReferenceError |
warn |
A $ref inside a vendor extension could not be resolved. |
Document/ReadOnlyUnionDiscriminator |
warn |
A union's discriminator is readOnly on a variant, so requests through the union go out untagged. |
Document/ReferenceError |
error |
A $ref in the OpenAPI document could not be resolved. |
Document/ContradictoryPropertyAccess
A property is marked both readOnly and writeOnly, so it should be sent in neither direction.
| Default severity | Fix lives in |
|---|---|
warn |
Your API description (document) |
When it fires
A property is marked both readOnly and writeOnly, so per OpenAPI it should be sent in neither direction: no request should carry it and no response should return it.
Changing or silencing it
Each finding's suppression key is <schema>.<property>.
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": {
"Document/ContradictoryPropertyAccess": "info"
},
"ignored": {
"Document/ContradictoryPropertyAccess": "<suppression key>"
}
}
}
Document/DiscriminatorMappingContradicted
A discriminator maps a value to a variant whose schema pins the discriminator to a different value.
| Default severity | Fix lives in |
|---|---|
warn |
Your API description (document) |
When it fires
A discriminator maps a value to a variant whose schema pins the discriminator property to a different value.
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": {
"Document/DiscriminatorMappingContradicted": "info"
},
"ignored": {
"Document/DiscriminatorMappingContradicted": "<suppression key>"
}
}
}
Document/DiscriminatorPropertyAbsent
A discriminator maps several values to a variant that does not declare the discriminator property.
| Default severity | Fix lives in |
|---|---|
warn |
Your API description (document) |
When it fires
A discriminator maps several values to a variant that does not declare the discriminator property.
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": {
"Document/DiscriminatorPropertyAbsent": "info"
},
"ignored": {
"Document/DiscriminatorPropertyAbsent": "<suppression key>"
}
}
}
Document/ExtensionReferenceError
A $ref inside a vendor extension could not be resolved.
| Default severity | Fix lives in |
|---|---|
warn |
Your API description (document) |
When it fires
A $ref inside a vendor extension the generator does not read cannot be resolved. Nothing generated depends on it, so it warns instead of failing. References under x-scalar-, x-fern-, x-stainless-, and x-speakeasy- are read by the generator and stay at error, except x-fern-examples, which the generator does not read.
Changing or silencing it
Each finding's suppression key is the $ref string.
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": {
"Document/ExtensionReferenceError": "info"
},
"ignored": {
"Document/ExtensionReferenceError": "<suppression key>"
}
}
}
Document/ReadOnlyUnionDiscriminator
A union's discriminator is readOnly on a variant, so requests through the union go out untagged.
| Default severity | Fix lives in |
|---|---|
warn |
Your API description (document) |
When it fires
A union's discriminator property is readOnly on a variant that does not declare the discriminator itself (on its own schema or an allOf base). Request types leave out readOnly members, so requests sent through the union carry no tag.
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": {
"Document/ReadOnlyUnionDiscriminator": "info"
},
"ignored": {
"Document/ReadOnlyUnionDiscriminator": "<suppression key>"
}
}
}
Document/ReferenceError
A $ref in the OpenAPI document could not be resolved.
| Default severity | Fix lives in |
|---|---|
error |
Your API description (document) |
When it fires
A $ref in the document cannot be resolved, typically an external file or URL that does not exist. Schemas that use it degrade to untyped values.
Changing or silencing it
Each finding's suppression key is the $ref string.
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": {
"Document/ReferenceError": "warn"
},
"ignored": {
"Document/ReferenceError": "<suppression key>"
}
}
}
See also
- Diagnostics: how findings are graded, located and suppressed
- Severity and failing the build
- Suppressing a finding
What did you think of this content?