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

Infer object type in definitions when possible #309

Merged
merged 3 commits into from
Jan 2, 2023
Merged

Conversation

balanza
Copy link
Contributor

@balanza balanza commented Jan 2, 2023

Description

  • Infer type=object when the definition has properties
  • Infer type=object when the definition has additional properties

Motivation and Context

Sometimes users have specifications non-100% compliant and do not specify type on definitions. Example: https:/pagopa/pn-commons/blob/develop/docs/openapi/pn-errors.yaml#L67.
In some cases, we can infer the correct type by looking at the other definition fields.

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Chore (improvement with no change in the behavior)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@balanza balanza requested a review from a team as a code owner January 2, 2023 12:34
@balanza balanza changed the title Infe\r object` type Infer object type in definitions when possible Jan 2, 2023
@pagopa-github-bot
Copy link
Contributor

Warnings
⚠️

Please include a Pivotal story at the beginning of the PR title (see below).

Example of PR titles that include pivotal stories:

  • single story: [#123456] my PR title
  • multiple stories: [#123456,#123457,#123458] my PR title

Generated by 🚫 dangerJS

@balanza balanza merged commit 8f4dd72 into master Jan 2, 2023
@balanza balanza deleted the infer-object-type branch January 2, 2023 14:00
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

Successfully merging this pull request may close these issues.

2 participants