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

[Bug]: Mandatory dictionary field remain mandatory when part of the request #1802

Open
kpanot opened this issue May 21, 2024 · 0 comments · May be fixed by #2059
Open

[Bug]: Mandatory dictionary field remain mandatory when part of the request #1802

kpanot opened this issue May 21, 2024 · 0 comments · May be fixed by #2059
Assignees
Labels
bug Something isn't working priority:high

Comments

@kpanot
Copy link
Contributor

kpanot commented May 21, 2024

Package name

core, schematics

Package version

Reproduction steps

  • Create a definition with mandatory field link to the dictionary (following example:)
definitions:
  Amount:
    type: object
    description: Amount expressed as value and currency code.
    required:
      - value
      - currencyCode
    properties:
      value:
        type: integer
        format: int64
        minimum: 0
      rawValue:
        type: string
      currencyCode:
        type: string
        pattern: '[A-Z]{3}'
        x-dictionary-name: currency
        x-field-name: currency
        x-field-type: CurrencyDictionaryItem
  • Use this definition in API response and in API request parameter

Current result

First issue: The request function typing requires the parameter to be provided with the dictionary field (which can be complicated to provided by the application).
Second issue: The dictionary field is serialized and sent to the API (which can lead to call rejection if strongly checked by the API).

Expected result

  • The definition should have a dictionary mandatory in response but optional or removed in request (maybe via a type helper or a duplication of interface?)
  • The serialization of the request should ignore the dictionary fields

Additional comments

No response

@kpanot kpanot added bug Something isn't working priority:high labels May 21, 2024
@kpanot kpanot self-assigned this Aug 13, 2024
@kpanot kpanot linked a pull request Aug 14, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority:high
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant