feature(kuma-http-api): add custom overlayer that can deref during overlay#4420
Conversation
✅ Deploy Preview for kuma-gui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@johncowen Don't know the full details of your use-case, but I just wanted to share that eopenapi-format, dereferences the OpenAPI document before processing it. |
|
Hey @thim81 👋 😄
Gotcha yeah, I've tried various ways whilst sticking to standard tooling/approaches, but I realized that in our very weird case we need to add This way we can overlay the targets of As this is a bit non standard overlay functionality I doubt there'll be any support in standard-ish tooling (and there probably shouldn't be) The PR here adds optional dereferencing to the overlay itself via a YAML tag, so we can choose which Anyway, a bit hard to explain our usecase 😅 but thats more or less it. BTW, thanks for the great tool, super handy! Seems to be the only one that supports OAS Overlay Anyway, no doubt catch up after the weekend |
schogges
left a comment
There was a problem hiding this comment.
LGTM so far, left some nits 🙂
9a8c47e to
0f01112
Compare
…erlay Signed-off-by: John Cowen <john.cowen@konghq.com>
Co-authored-by: Mo <24444046+schogges@users.noreply.github.com> Signed-off-by: John Cowen <johncowen@users.noreply.github.com>
Signed-off-by: John Cowen <john.cowen@konghq.com>
Signed-off-by: John Cowen <john.cowen@konghq.com>
Signed-off-by: John Cowen <john.cowen@konghq.com>
0f01112 to
6ee6751
Compare
|
FYI Added this to the desc here:
Taking out of draft Thanks again @thim81 ! |
See title, should probably be merged after #4420 seeing as it includes functionality from that. Signed-off-by: John Cowen <john.cowen@konghq.com>
Adds a smol wrapper around https://github.com/thim81/openapi-format (which is the overlay lib/CLI we are using) to allow us to dereference
$refs before the overlay happens.I decided to add our own custom CLI instead of composing CLI calls using
makebecause I wanted to avoid making lots of intermediate files though the pipeline. This way you have one overlay source file and a single generated OpenAPI spec.I've made some inline notes to help review, but also note there are a few formatting changes just due to the multiple bits of serializing/deserializing happening as the YAML goes through the pipeline.
Lastly, we can't really merge this as yet as we need the upstream issue resolved - worst case scenario we are going to have to patch or fork the upstream lib - or potentially find another overlay tool/lib that we can use. Leaving in Draft for the moment, but a totally open for review and potential informal approval at this stage 👍Upstream bugfix is in, I've added a couple of commits on the end of here for the upgrade of
openapi-formatand then one moremake build- packages/kuma-http-api/dist/components/schemas/MeshAccessLogItem_Put_RequestBody.yaml is now how we want it 🎉