openapi icon indicating copy to clipboard operation
openapi copied to clipboard

wip: add openapi3 schema

Open c-cube opened this issue 5 years ago • 2 comments

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

c-cube avatar Apr 18 '20 01:04 c-cube

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:

https://github.com/disruptek/openapi/blob/6a4424fc184c61781b16d5f75cdd3d809736673f/src/openapi/codegen.nim#L140-L141

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?

iffy avatar Dec 03 '21 14:12 iffy

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. :wink:

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. :tada:

disruptek avatar Dec 03 '21 18:12 disruptek