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

feat: allow servers and channels to be defined as components #665

Merged

Conversation

smoya
Copy link
Member

@smoya smoya commented Dec 2, 2021

Note that this PR is targeting asyncapi:2022-01-release branch, so merging it won't release a new version.

Description
This PR is part of #660.
It allows both servers and channels to be defined as (and referenced from) components, meaning the following will be now valid:

servers:
  production:
    $ref: '#/components/servers/myserver'
channels:
  some/events:
    $ref: '#/components/channels/myChannel'
components:
  servers:
    myserver:
      url: "http://localhost:5000/ws"
      protocol: ws
  channels:
    myChannel:
      description: "mychannel"

Related issue(s)
#660

@smoya smoya added the 💭 Strawman (RFC 0) RFC Stage 0 (See CONTRIBUTING.md) label Dec 2, 2021
@derberg
Copy link
Member

derberg commented Dec 2, 2021

@smoya fyi this pr goes to master, not release branch. Also, we release stuff from release branches, we create release candidates that are automatically published to the website. So you should have prefix feat: as you are introducing a feature

FYI, I haven't looked into the proposal itself, just quickly noticed what you wrote when I saw a pop up in slack channel and thought I will give you a quick heads up. For proposals, I plan to delegate some time next week to jump into the review in spec repo

@smoya smoya changed the base branch from master to 2022-01-release December 2, 2021 16:33
@smoya smoya changed the title docs(spec): allow servers and channels to be defined as components feat: allow servers and channels to be defined as components Dec 2, 2021
@smoya smoya force-pushed the feat/serversChannelsAsComponents branch from c9023da to 4658b28 Compare December 28, 2021 11:20
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@smoya
Copy link
Member Author

smoya commented Dec 28, 2021

This branch is now up-to-date with 2022-01-release and all conflicts have been solved.
Also, the social media example has been edited to illustrate the changes. As mentioned in #660 (comment):

unfortunately, the only thing it can be moved to components is one of the servers. See the diff here.
The reason for not moving the rest of servers and channels is because some field change, such as the descriptiion and, as per today, our reference and bundling system does not support fields to be overridden (We follow JSON Reference).

cc @derberg

Copy link
Member

@derberg derberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/dnm

@derberg derberg added 🏁 Accepted (RFC 3) RFC Stage 3 (See CONTRIBUTING.md) and removed 💭 Strawman (RFC 0) RFC Stage 0 (See CONTRIBUTING.md) do-not-merge labels Jan 13, 2022
@derberg
Copy link
Member

derberg commented Jan 13, 2022

All stuff in place, reference implementation provided and will be released to release branches after this merge.

/rtm

@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 2.3.0-2022-01-release.2 🎉

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants