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

wip: add openapi3 schema #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

c-cube
Copy link

@c-cube c-cube commented Apr 18, 2020

(very much in progress, didn't go through the whole thing yet)

@iffy
Copy link

iffy commented Dec 3, 2021

I'm looking at moving this forward (I want to use the Apple App Store Connect API). As I'm trying to make it work, I'm encountering code in codegen.nim that is specific to v2.

For instance in version 2 you can't have a schema within a parameter unless it's InBody, but with v3 you can, so this code is wrong for v3:

elif result.location != InBody and "schema" in js:
error "schema is inappropriate for " & $result & "\n" & js.pretty

Do you have recommendations for which of these to pursue?

  • Make a new Parameter (e.g. V3Parameter)?
  • Make a codegen3.nim?
  • Add v3 versions of procs in the same codegen.nim?
  • Add procs to schema2.nim and schema3.nim?

@disruptek
Copy link
Owner

It's been a long time since I wrote this stuff but it makes the most sense, to me, to separate into schema2 and schema3 since otherwise, the central logic will be corrupted by having to know about schema versions, which is the exact problem you're trying to work around in the first place. 😉

In any event, thanks for working on this and let me know if I can help further -- it's definitely something on my (very long) TODO list, so together we will make it happen one way or another. 🎉

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.

3 participants