[Open API 3.1] Json31 is incorrectly assuming that property containing `anyOf` is of type: object
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start with the linked Json31.java file, especially Json31.pretty() around line 38, and compare its output for the shown anyOf-only image, size, and color properties with the supplied schema. Verify that the serialized properties no longer gain an unexpected object type while retaining their string-or-null anyOf definitions.
Written by the indexing model from the issue text.
Description
Using Json31.pretty() I'm getting back properties with anyOf containing "type": "object"
"image" : {
"type" : "object",
"anyOf" : [ {
"type" : "string"
}, {
"type" : "null"
} ],
"title" : "Image"
},
but this doesn't match my schema below, image doesn't contain "type": "object" :
"PreviewProduct": {
"properties": {
"id": {
"type": "string",
"title": "Id"
},
"handle": {
"type": "string",
"title": "Handle"
},
"title": {
"type": "string",
"title": "Title"
},
"productType": {
"type": "string",
"title": "Producttype"
},
"image": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Image"
},
"size": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Size"
},
"color": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Color"
}
},
"type": "object",
"required": [
"id",
"handle",
"title",
"productType"
],
"title": "PreviewProduct",
"description": "NOTE: This class is auto generated by OpenAPI Generator ([https://openapi-generator.tech).\n\nDo](https://openapi-generator.tech)./n/nDo) not edit the class manually.\n\nPreviewProduct - a model defined in OpenAPI\n\n id: The id of this PreviewProduct.\n handle: The handle of this PreviewProduct.\n title: The title of this PreviewProduct.\n product_type: The product_type of this PreviewProduct.\n image: The image of this PreviewProduct [Optional].\n size: The size of this PreviewProduct [Optional].\n color: The color of this PreviewProduct [Optional]."
}
- Dominant language
- Java
- Stars
- 867
- Forks
- 560
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 7
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.
More from swagger-api/swagger-parser
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
swagger-api/swagger-parser#2386 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
swagger-api/swagger-parser#2168 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
swagger-api/swagger-parser#1922 · 2 comments · 1 reaction ·
-
[Bug]: Regression: resolveFully fails when components key does not match external file basename OpenBug
Difficulty 4/5 3-5 days Newbie friendliness 58/100
swagger-api/swagger-parser#2399 · 3 comments ·
-
Bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
swagger-api/swagger-parser#2395 ·
All issues in swagger-api/swagger-parser
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100