jdemaeyer / brightsky

JSON API for DWD's open weather data.
https://brightsky.dev/
MIT License
287 stars 18 forks source link

Inconsitency in yml? #156

Closed miasbeck closed 8 months ago

miasbeck commented 8 months ago

For the /alerts request, there seems to be a discrepancy between the API specification in brightsky.yml and the actual result.

According to the yml, the location field should be an array, but it seems to be ever a single object.

I created a REST client in Microsoft Visual Studio from the yml file, and it returns an error when the request is executed.

I then adjusted the yml file as follows, and there was no more error and the result looks OK∴

From line 459:

location
  type: array
    items:
      $ref: "#/components/schemas/Location"

replaced with:

location:
    $ref: "#/components/schemas/Location"
jdemaeyer commented 8 months ago

Hi @miasbeck, thanks a lot for the report and for your research – you indeed hit the nail on the head! If you want you can create a pull request with the change you outlined so GitHub will show you as a contributor (as you deserve ;)), but if you feel that's too much trouble I can just add the change myself, just lemme know!

miasbeck commented 8 months ago

I would prefer you to make the changes yourself. I'm a layman when it comes to gitbub and pull requests and don't want to mess up this great repository. Thanks for reporting back!

jdemaeyer commented 8 months ago

Sure, no worries! I've updated the OpenAPI YAML spec and it should be live now. If you find the time, could you take a look if the generated REST client works now?

2c2e6ed

miasbeck commented 8 months ago

The newly generated client works perfectly - happy to delete my "hack" now.

jdemaeyer commented 8 months ago

Perfect, thanks for checking!