forked from go-openapi/spec
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
circular $ref expansion: fixed edge cases
* fixes go-openapi#94 * now expanded $ref's are always contained in the resulting document. All circular $ref that used to resolve to a remote $ref now resolve as a json pointer inside the expanded document. Pointer resolution prefers pointers to definitions. * added additional test case for remote cyclical $ref, from azure API * schema IDs are removed from the expanded spec: schemas expanded from some schema ID reference now refer to the new expanded root document. * circular IDs are resolved against the corresponding root document. > NOTE(1): uncovered pre-existing issue with nested schema ID involving cyclical references. > This case remains unsupported and is illustrated by test case: circular_test.go#L198 ("withID") > NOTE(2): pre-existing issue with non-deterministic expansion remains unsolved, > although the election of the replacing pointer inside the root document > somewhat reduces the scope of this problem. > > This case remains illustrated by a minimal test case: circular_test.go#L46 ("minimal"), > which expands correctly, but with changing results. > NOTE(3): notice that expansion is still not an idempotent transform, in the presence > of cyclical $ref's: another run on an expanded spec with remaining cyclical $ref > will expand further down and detect again the cycle. > > The result remains functionally correct, as illustrated by test case: circular_test.go#L168 ("CircularID"). > Notice that this test case reproduces a validation fixture from jsonschema test (passed by go-openapi/validate). Signed-off-by: Frederic BIDON <[email protected]>
- Loading branch information
Showing
49 changed files
with
21,619 additions
and
436 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.