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

property name seems to have to match ref name #55

Closed
alexec opened this issue Jan 13, 2017 · 5 comments
Closed

property name seems to have to match ref name #55

alexec opened this issue Jan 13, 2017 · 5 comments

Comments

@alexec
Copy link

alexec commented Jan 13, 2017

This does not work:

      countryCode:
        "$ref": "#/definitions/countryCodes"
Caused by: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "countryCode" (class des.yaml.AddressType), not marked as ignorable (6 known properties: "countryCodes", "postalCode", "addressLine1", "addressLine2", "addressLine3", "addressLine4"])
 at [Source: [B@2717a928; line: 16, column: 10] (through reference chain: des.yaml.CreateCustomerSubscription["customerCreateOrExtend"]->des.yaml.CreateCustomerSubscriptionCustomerCreateOrExtend["businessAddressDetails"]->des.yaml.AddressType["countryCode"])

But removing the plural "s" does?

      countryCode:
        "$ref": "#/definitions/countryCode"
@slavaschmidt
Copy link
Collaborator

Seems like a bug

@alexec
Copy link
Author

alexec commented Mar 2, 2017

Workaround

Cannot have the field name different to the type. E.g. countryCode must have a definition named countryCode, not countryCodes.

Good:

"countryCode": "#/definitions/countryCode"

Bad:

"countryCode": "#/definitions/countries"

@LappleApple
Copy link

Hi @alexec, would you like to make a PR to address this bug?

@slavaschmidt
Copy link
Collaborator

Hi @alexec, would it be possible for you to provide a full failing specification? I've glossed over simple.pestore.api.yaml and found for example following snippet:

parameters:
        - name: pet
          in: body
          description: Pet to add to the store
          required: true
          schema:
            $ref: '#/definitions/newPet'

which confirms that name of the parameter does not need to be related to the name of the type.

@alexec
Copy link
Author

alexec commented Apr 9, 2017

Sorry - due to change in work, I'm afraid I won't have a chance to look at this. Feel free to close.

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

No branches or pull requests

3 participants