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

allow *yaml* in ouput #211

Closed
JohnRDOrazio opened this issue May 2, 2024 · 5 comments
Closed

allow *yaml* in ouput #211

JohnRDOrazio opened this issue May 2, 2024 · 5 comments
Milestone

Comments

@JohnRDOrazio
Copy link
Member

Currently, the API has a preference for JSON output, with some support for XML output and ICS output. However nowadays another popular data exchange format is YAML. We should enable a request for Content Type application/yaml.

This will require enabling the pecl extension yaml-emit on the server and implementing a minimum amount of logic to allow the transform on output.

@JohnRDOrazio JohnRDOrazio added this to the v4.0 milestone May 2, 2024
@JohnRDOrazio
Copy link
Member Author

first step taken, pecl package is now installed on the server!

@JohnRDOrazio
Copy link
Member Author

apparently yaml_emit cannot directly handle PHP objects, only associative arrays (see php/pecl-file_formats-yaml issue #70). So unless that's ever a thing, we'll just have to json_decode(json_encode($output),true) to get an associative array, and then yaml_emit from there.

@JohnRDOrazio
Copy link
Member Author

JohnRDOrazio commented May 2, 2024

Implemented in commits c734a38...82bbf7c !

@JohnRDOrazio
Copy link
Member Author

and added application/yaml to the OpenAPI schema in commit 82bbf7c...a359952 !
This issue is now complete!

@JohnRDOrazio
Copy link
Member Author

yaml validation is now a thing too, in the litcal-tests interface! Implemented validation here in LitCalHealth and added the option in the tests interface.

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

1 participant