-
-
Notifications
You must be signed in to change notification settings - Fork 428
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
Add reference to originating locations in YAML specs - step 1 #1007
Open
reuvenharrison
wants to merge
29
commits into
getkin:master
Choose a base branch
from
oasdiff:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
20a9abd
add origin - step 1
reuvenharrison f90371a
delete origin from content
reuvenharrison 7d41bd0
point to Origin
reuvenharrison 77f909b
make include origin configurable
reuvenharrison 15e7cab
generic unmarshalStringMap
reuvenharrison 450e4d0
add origin to more components
reuvenharrison 6b52b19
revert comments
reuvenharrison 775ab17
use const originKey
reuvenharrison d241445
comment to Scopes
reuvenharrison 206c1be
test more specs
reuvenharrison 032ff76
Fix Discriminator
reuvenharrison 4304772
update docs
reuvenharrison 67ee9fa
test on a decent set of dedicated specs
reuvenharrison 8095459
remove trainling spaces
reuvenharrison d24b68a
add comments
reuvenharrison c5cf284
remove trailing whitespace
reuvenharrison 98ace80
update docs
reuvenharrison c981f30
dedicated tests
reuvenharrison 6daf324
update docs
reuvenharrison 17db6ab
remove whitespace
reuvenharrison 015b63e
rm empty line
reuvenharrison 34f95b7
rm last newline
reuvenharrison 020e44b
add tests
reuvenharrison 07a3b25
rm unused test files
reuvenharrison cba19cf
update deps
reuvenharrison 2d5e393
fix paths test
reuvenharrison b9f7dd6
test components/security
reuvenharrison aa8c5b1
fix LF
reuvenharrison 8a00ba0
include origin in unmarshal maps
reuvenharrison File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,9 +9,10 @@ import ( | |
// See https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#discriminator-object | ||
type Discriminator struct { | ||
Extensions map[string]any `json:"-" yaml:"-"` | ||
Origin *Origin `json:"origin,omitempty" yaml:"origin,omitempty"` | ||
|
||
PropertyName string `json:"propertyName" yaml:"propertyName"` // required | ||
Mapping map[string]string `json:"mapping,omitempty" yaml:"mapping,omitempty"` | ||
PropertyName string `json:"propertyName" yaml:"propertyName"` // required | ||
Mapping StringMap `json:"mapping,omitempty" yaml:"mapping,omitempty"` | ||
Comment on lines
-14
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please move the introduction of the |
||
} | ||
|
||
// MarshalJSON returns the JSON encoding of Discriminator. | ||
|
@@ -44,6 +45,7 @@ func (discriminator *Discriminator) UnmarshalJSON(data []byte) error { | |
return unmarshalError(err) | ||
} | ||
_ = json.Unmarshal(data, &x.Extensions) | ||
delete(x.Extensions, originKey) | ||
delete(x.Extensions, "propertyName") | ||
delete(x.Extensions, "mapping") | ||
if len(x.Extensions) == 0 { | ||
|
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
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
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
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.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please define these in their respective files