mgirlich / tibblify

Rectangle Nested Lists
https://mgirlich.github.io/tibblify/
GNU General Public License v3.0
67 stars 2 forks source link

Include other fields in `parse_openapi_spec()` #191

Open mgirlich opened 1 year ago

mgirlich commented 1 year ago

Closes #190. This now parses most of the fields in the OpenAPI spec. But there are some fields that can't (yet?) be covered by tibblify, e.g. minItems and maxItems, the description or even the enums.

jonthegeek commented 9 months ago

I'm finally digging into this (after realizing it will cover a lot of what I'm over-engineering for beekeeper). For the APIs on apis.guru, of those with an openAPI version >= 3.0, 827 parsed (mostly) successfully, and 694 threw an error and failed. Honestly that's probably good enough for me right now, but it would be great to work through and figure out what fails!

The "mostly" in the successful batch comes from warnings:

Warning message:
There were 3747 warnings in `dplyr::mutate()`.
The first warning was:
ℹ In argument: `paths = purrr::map2(...)`.
Caused by warning in `yaml.load()`:
! NAs introduced by coercion: 1602844091815 is out of integer range
ℹ Run dplyr::last_dplyr_warnings() to see the 3746 remaining warnings. 

Of those 3747 warnings, all but 6 were that same "NAs introduced by coercion" family. We might be able to avoid that by treating everything as character with a handler in yaml.load(). I'll have to dig in and see exactly where that happens.

The other 6 warnings were URLs that needed to be urlencoded, such as https://api.apis.guru/v2/specs/drchrono.com/v4 (Hunt Valley)/openapi.json

I see that this is now behind main. What else would we need to do to get this finalized? It definitely seems like an improvement over what you have, and it's getting really close to the full thing!