Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Open API 3.1] Json31 is incorrectly assuming that property containing anyOf is of type: object #4810

Open
daniel-urrutia opened this issue Dec 13, 2024 · 0 comments

Comments

@daniel-urrutia
Copy link

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]."
      }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant