encoding/opeanpi: paths parsing for OpenAPI spec#1727
encoding/opeanpi: paths parsing for OpenAPI spec#1727qequ wants to merge 32 commits intocue-lang:masterfrom
Conversation
Update pathBuilder struct
…rations now the paths are checked with a prefix of the form $/ instead of $
…the case of a wrong http status code
now checking with a regex with words of the form (...)/(...)
…iption parsing in operations
Update pathBuilder struct
…rations now the paths are checked with a prefix of the form $/ instead of $
…the case of a wrong http status code
now checking with a regex with words of the form (...)/(...)
…iption parsing in operations
encoding/openapi/build.go
Outdated
| } | ||
|
|
||
| return ast.NewList(items...) | ||
| //pb.path.Set("security", ast.NewList(items...)) |
encoding/openapi/pathResponse.go
Outdated
|
|
||
| } | ||
|
|
||
| //rb.mediaTypes.Set("description", description) |
|
I started hacking against this pr and looking at original tickets and thought i would leave what i learned:
|
@qequ pls address this |
|
@araddon the only feature I worked on in this PR was the encoding |
|
@araddon anything else we can help to get this in? |
|
ping? @araddon |
|
All the work here is much appreciated, but I think we need to have a coherent design for how all of OpenAPI might eventually fit into this framework, not just paths, before we can decide if this approach is the right one. Issue #3133 is probably the place to discuss that. |
Implemented parsing for paths in cue when interpreting OpenAPI.
parsing functionality of most of the objects of a path as given by swagger spec;
Parsing notes;
Instead of using a single paths top declaration object defined "Paths" as suggests #386 each path is written separately as a top decl object withe the prefix " $/ ", similarly as Components Objects are defined using definitions.
If Security is defined as a Path Item object, that Security list will be applied to all the operations
For parsing Media Type Objects schemas, Components Objects schemas parsing functionality was reused
Added unit tests
All tests passed (running
go test ./...)Fixes #386 #735