swagger-api / swagger-api/swagger-parser
readonly is ignored for array property in model.
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 867
- Forks
- 560
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 7
Description
If a model has a readOnly array property, readOnly field is ignored and set to null when parsed with swagger parser.
Consider definition shown below.
Category:
type: object
properties:
id:
type: integer
format: int64
users:
type: array
items:
$ref: '#/definitions/User'
readOnly: true
xml:
name: Category
Property "users" is an array of type "User" which is readOnly.
Swagger parser ignores readOnly and when parsed, readOnly is set to null.
Swagger swagger = new SwaggerParser().read("test.yaml");
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
Start at SwaggerParser().read("test.yaml") and use the supplied test.txt definition to trace how the readOnly array property is parsed. Done means the users property retains readOnly: true instead of becoming null when the model is read.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100