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

Improve OpenAPI definition #392

Merged
merged 1 commit into from Jul 4, 2023
Merged

Conversation

melix
Copy link
Contributor

@melix melix commented Jul 4, 2023

I am one of the developers of the Micronaut Framework. As part of writing a guide for our OpenAPI support, I was contemplating using Open Meteo as an example service.

I was happy to find it was coming with an OpenAPI spec. However, the response types are not precise enough for our generated code. Typically, return types are often Object instead of something strongly typed.

This commit fixes this by introducing component types with the appropriate return types. I'm not an OpenAPI expert but I have verified that this fixes the issue I was seeing.

I am one of the developers of the [Micronaut Framework](https://micronaut.io/). As part of writing a guide for our [OpenAPI support](https://github.com/micronaut-projects/micronaut-openapi/), I was contemplating using Open Meteo as an example service.

I was happy to find it was coming with an OpenAPI spec. However, the response types are not precise enough for our generated code. Typically, return types are often `Object` instead of something strongly typed.

This commit fixes this by introducing component types with the appropriate return types. I'm not an OpenAPI expert but I have verified that this fixes the issue I was seeing.
@patrick-zippenfenig
Copy link
Member

Awesome, thanks!

This is a great addition and I will add more weather variables in another commit. Just a couple of weeks ago the Swift server group announced more tools for OpenAPI Swift integration. This will help to automate integration and make sure the schema definition is always up to date

@patrick-zippenfenig patrick-zippenfenig merged commit 54e4f84 into open-meteo:main Jul 4, 2023
2 checks passed
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.

None yet

2 participants