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

Object types being inferred as undefined #1807

Open
BernardoSM opened this issue Aug 11, 2024 · 1 comment
Open

Object types being inferred as undefined #1807

BernardoSM opened this issue Aug 11, 2024 · 1 comment

Comments

@BernardoSM
Copy link

Describe the bug

My openapi spec has an object type but on my fets client is showing only undefined.

To Reproduce Steps to reproduce the behavior:

Generate an openapi with this item and instantiate a fets client:

//...
"id_doc_front_file": {
    "type": [
      "object",
      "null"
    ],
    "properties": {
      "url": {
        "type": "string",
        "format": "uri",
        "example": "https://example.com/document.pdf"
      },
      "name": {
        "type": "string",
        "example": "File name.jpg"
      },
      "size": {
        "type": "number",
        "example": 123456
      }
    },
    "required": [
      "url",
      "name",
      "size"
    ]
  }
//... 

Expected behavior

It should be inferred as an object with three keys: url, name and size.

But is inferring as undefined:

CleanShot 2024-08-10 at 23 27 39

Environment:

  • OS: Macos Sonoma
  • Openapi Version: 3.1.0
  • NodeJS: 20.9.0
@ardatan
Copy link
Owner

ardatan commented Aug 16, 2024

Are you sure if it is valid to have both object and null in type as an array because there is always properties there?

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

2 participants