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

feature request: workaround OpenAPI/PHP's lack of support for oneOf #926

Open
sxlijin opened this issue Sep 6, 2024 · 0 comments
Open

Comments

@sxlijin
Copy link
Collaborator

sxlijin commented Sep 6, 2024

OpenAPI's PHP generator has a bug when it comes to oneOf of primitive types. If someone runs into this we'll need to help them out with this, it's really friggin' bizarre.

This parsed response in BAML:

image

Becomes this in PHP:

        echo "<pre> ParseEmail was a FlightConfirmation as json: " . $resp->__toString() . "</pre>";
image
@sxlijin sxlijin changed the title bug in OpenAPI/php: unions of primitives drop data feature request: workaround OpenAPI/PHP's lack of support for oneOf Sep 6, 2024
sxlijin added a commit to BoundaryML/baml-examples that referenced this issue Sep 6, 2024
- add a ruby example
- nulls are now handled with significantly less boilerplate
- oneOfs are handled (mostly) correctly (PHP is an unfortunate exception: BoundaryML/baml#926)
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

No branches or pull requests

1 participant