Skip to content
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

Use maps instead of arrays when possible #245

Merged
merged 2 commits into from
Jul 31, 2019

Conversation

fmvilas
Copy link
Member

@fmvilas fmvilas commented Jul 25, 2019

Changes:

  • Makes parameters a map instead of an array. This way we always make sure a name is provided.
  • Makes servers a map instead of an array. It gives us the advantage of assigning names to each server, e.g. production, development, staging, etc.

The reason behind this change is to facilitate the #107 and #108 features. These features make use of JSON Merge Patch and arrays are particularly "problematic" when trying to merge 2 or more. In the case of JSON Merge Patch, 2 arrays can't be merged and instead the second replaces the first one. If we remove unnecessary arrays from the spec, it will be possible to merge these objects too.

@fmvilas
Copy link
Member Author

fmvilas commented Jul 31, 2019

I'm moving forward and gonna merge this PR. Please, if you see something wrong, missing, or just don't agree with the changes, don't hesitate to leave a comment after it's merged. I'll be happy to address these questions afterward.

@fmvilas fmvilas merged commit 3aca663 into master Jul 31, 2019
@fmvilas fmvilas deleted the feature/use-maps-instead-of-arrays-when-possible branch July 31, 2019 09:34
@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants