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

Parameters missing "maxLength", "nullable" props output, Type 'object' no longer notated #100

Closed
simranbentel opened this issue Dec 16, 2021 · 3 comments · Fixed by #112
Closed
Assignees

Comments

@simranbentel
Copy link

In latest v0.3.0 release, object type is no longer notated in the table of parameters (previously, the top level amount param had "object" type notated:
Screen Shot 2021-12-16 at 1 55 07 PM

Another couple of props are missing from the output. For example, given this param:

"correlationId": { "maxLength": 40, "type": "string", "description": "Invoice correlation id", "nullable": true, }

Actual output:
Screen Shot 2021-12-16 at 2 03 57 PM

Expected:
Screen Shot 2021-12-16 at 2 04 33 PM
The "Nullable" and maxLength are being omitted.

@bourdakos1
Copy link
Member

In latest v0.3.0 release, object type is no longer notated in the table of parameters (previously, the top level amount param had "object" type notated

This doesn't look like a regression, I'm still seeing the proper schema name listed for objects. I'm guessing this is a bug for schema using allOf. I'll test it out and try to fix.

The "Nullable" and maxLength are being omitted.

Is nullable different from not being required?

@simranbentel
Copy link
Author

In latest v0.3.0 release, object type is no longer notated in the table of parameters (previously, the top level amount param had "object" type notated

This doesn't look like a regression, I'm still seeing the proper schema name listed for objects. I'm guessing this is a bug for schema using allOf. I'll test it out and try to fix.

The "Nullable" and maxLength are being omitted.

Is nullable different from not being required?

Indeed nullable is not required. As long as required is displayed nullable is not needed. My mistake.

@bourdakos1
Copy link
Member

Okay cool, #102 should fix the allOf issue. I'll open another PR to add support for the following qualifiers (let me know if I missed anything important):

  • maxLength
  • minLength
  • maximum
  • minumum
  • exclusiveMaximum
  • exclusiveMinimum
  • maxItems
  • minItems
  • uniqueItems
  • maxProperties
  • minProperties
  • multipleOf
  • pattern

if you have a schema with:

slug:
  type: string
  description: The human-readable, unique identifier, used to identify the document.
  minLength: 1
  maxLength: 40
  pattern: "^[a-zA-Z0-9_-]*$"
  required: true

would render:

slug string - REQUIRED

Possible values: 1 ≤ length ≤ 40, Value must match regular expression ^[a-zA-Z0-9_-]*$

The human-readable, unique identifier, used to identify the document.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants