Skip to content

Use different order of arguments for json merge#998

Merged
deepmap-marcinr merged 1 commit intooapi-codegen:masterfrom
gerhardwagner:change-union-merge
Mar 14, 2023
Merged

Use different order of arguments for json merge#998
deepmap-marcinr merged 1 commit intooapi-codegen:masterfrom
gerhardwagner:change-union-merge

Conversation

@hhelmken
Copy link
Copy Markdown
Contributor

Taken from function documentation of JsonMerge:

// JsonMerge merges two JSON representation into a single object. `data` is the
// existing representation and `patch` is the new data to be merged in
func JsonMerge(data, patch json.RawMessage) (json.RawMessage, error)

First argument should be existing data, second argument the patch to be applied. This pull requests changes the order of the arguments passed into JsonMerge and uses the union value as existing data. For me this sounds more reasonable, if the current implementation is intended I'd be happy to know the reasons why.

@deepmap-marcinr deepmap-marcinr merged commit adf8a06 into oapi-codegen:master Mar 14, 2023
@hhelmken hhelmken deleted the change-union-merge branch May 15, 2023 13:58
adrianpk pushed a commit to foorester/oapi-codegen that referenced this pull request Jan 16, 2024
adrianpk added a commit to foorester/oapi-codegen that referenced this pull request May 31, 2024
danicc097 pushed a commit to danicc097/oapi-codegen that referenced this pull request Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants