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

Add Support for Polymorphic Response Field Types #168

Open
wants to merge 2 commits into
base: 1.3
Choose a base branch
from

Conversation

GuyPaddock
Copy link

@GuyPaddock GuyPaddock commented Aug 13, 2019

This allows fields within a response model to vary within a set of allowed types instead of being required to be a specific JSON schema value type.

This also corrects detection of null response values. It also fixes detection of associative vs. indexed arrays so that the order in which the type definitions appear in the service description doesn't affect which type gets returned when a field can be either an object or an array.

Depends on #167 (to fix the test suite), and closes #165.

(If this should be based off of the develop branch, per #170, let me know and I will rebase it).

Guy Elsmore-Paddock added 2 commits August 12, 2019 22:20
…atibility

PSR-7 requires a method to be set on Request objects at the time they
are created, but the Operation object previously defaulted the method to
an empty string. Now we default it to 'GET', which should be a safe
choice.

In addition, if a request is misconfigured to force the request method
to an empty string, there is now a validation for that.

Closes guzzle#166.
This allows fields within a response model to vary within a set of
allowed types instead of being required to be a specific JSON schema
value type.

This also corrects detection of null response values. It also fixes
detection of associative vs. indexed arrays so that the order in which
the type definitions appear in the service description doesn't affect
which type gets returned when a field can be either an object or an
array.

Closes guzzle#165.
@GuyPaddock GuyPaddock force-pushed the feature/polymorphic-response-model-type branch from 0462ad1 to cacd25c Compare August 13, 2019 03:57
@GuyPaddock GuyPaddock changed the base branch from master to develop August 21, 2019 05:36
@GuyPaddock GuyPaddock changed the base branch from develop to master August 21, 2019 05:38
@GrahamCampbell
Copy link
Member

Are you able to rebase this and remove the other commit relating to HTTP method?

@GuyPaddock
Copy link
Author

@GrahamCampbell Can you elaborate on why the GET part needs to be removed?

@GrahamCampbell
Copy link
Member

Because that has already been fixed, in a different way.

@GuyPaddock
Copy link
Author

GuyPaddock commented Nov 30, 2022

@GrahamCampbell The fix for GET was done in the wrong spot. I left a note for you on 8f8992f. #167 was the correct fix.

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.

Support for Multiple type Options within Response Models
2 participants