OpenAPITools / OpenAPITools/openapi-generator
attribute components.schemas.test.default is not of type `string`
Open
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Description
The generator throw "attribute components.schemas.test.default is not of type string" when property is of type array and default value is array.
openapi-generator version
3.3.1
OpenAPI declaration file content or url
"schema": {
"type": "array",
"items": {
"type": "string"
},
"default": [
{
"id": "asc"
}
]
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file or test is named. Start by reproducing the error from the supplied OpenAPI declaration using openapi-generator 3.3.1, then trace the validation path for an array schema with an array default. Done means the declaration is accepted without the string-type error and the behavior is covered by regression testing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, openapi
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100