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

format and ruleset: AsyncAPI #965

Closed
philsturgeon opened this issue Feb 14, 2020 · 2 comments · Fixed by #974
Closed

format and ruleset: AsyncAPI #965

philsturgeon opened this issue Feb 14, 2020 · 2 comments · Fixed by #974
Assignees
Labels
enhancement New feature or request p/high

Comments

@philsturgeon
Copy link
Contributor

User story.
As an AsyncAPI, I will get validation and a reasonable set of default opinions when working with AsyncAPI files.

Is your feature request related to a problem?
Right now spectral doesn't know what AsyncAPI is. It'll recognize $ref'ed schema files, but not the main thing, so I cannot write rules for channel names, etc.

Describe the solution you'd like

A ruleset based on OpenAPI (started here apisyouwonthate/style-guide#4).

AsyncAPI is important enough that it should be another core ruleset, not done over at openapi-contrib. We will almost certainly split rulesets out into their own NPM modules in the future, but for now, let's get this one in the core.

@philsturgeon philsturgeon added enhancement New feature or request p/high labels Feb 14, 2020
@nulltoken nulltoken mentioned this issue Feb 19, 2020
10 tasks
@nulltoken
Copy link
Contributor

@philsturgeon Started to work on this.

@derberg
Copy link

derberg commented Feb 25, 2020

Hey, I'm working on this issue in AsyncAPI generator asyncapi/generator#182 and it triggered an interesting discussion on slack, on how to treat the case of servers.url that has variables defined, but with whitespaces. In theory, user can create such a variable as { port} because technically he could get:

variables:
  " port":
       default: 80

The thing is, it is possible, but the probability is very low.

I think that for you it would be a nice use case, for a nifty rule, that spec owner gets a:

  • warning that the variable that he has in theurl has whitespaces
  • error that the variable defined in the url is not declared in variables object

just letting you know in case you are looking for ideas ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request p/high
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants