valid-schema-default-value
Overview
This rule belongs to the openapi-v3-standards-linting ruleset and states that:
The default value specified for the Schema Object using the default property should be valid for the type definition of that schema.
| Property | Value |
|---|---|
| Enabled | Yes |
| Maximum Severity | Warning |
| Message | Schema Object default value does not conform to its type definition. |
| Code | OPENAPI3STANDARDS_L190 |
| Type | Linting |
| Rule System | Semantic |
| Broad Category | Schemas |
| Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
| Tags | openapi3 openapi standards semantic linting default value default value schema |
Suggested Fixes
- Ensure that schema default value conforms to the schema type definition.
- Check that no required properties are missing in the default value.
- Check that types of all properties match those specified in the schema definition.