Draft
Conversation
Codecov Report
@@ Coverage Diff @@
## master #137 +/- ##
==========================================
+ Coverage 62.18% 63.08% +0.90%
==========================================
Files 27 27
Lines 2052 2086 +34
==========================================
+ Hits 1276 1316 +40
+ Misses 605 592 -13
- Partials 171 178 +7
Continue to review full report at Codecov.
|
* 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 <fredbi@yahoo.com>
89c3074 to
e606f6b
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
circular $ref expansion: fixed edge cases
fixes Expander: expanded document is not self-contained with some circular $ref patterns #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.
Signed-off-by: Frederic BIDON fredbi@yahoo.com