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

Base topic starting with a dot? #82

Closed
AtosNicoS opened this issue Jul 19, 2018 · 2 comments
Closed

Base topic starting with a dot? #82

AtosNicoS opened this issue Jul 19, 2018 · 2 comments
Labels

Comments

@AtosNicoS
Copy link

AtosNicoS commented Jul 19, 2018

The base topic are defined as strings:
https://github.com/asyncapi/asyncapi#baseTopicString

Normal topics are not allowed to start with a dot:
https://github.com/asyncapi/asyncapi#topicsObject

Now a few things are unclear that should be added to the documentation (explanation) or specification:

  • Why is a leading dot not allowed for topics (clarify doc) -> I know its bad practise but possible for mqtt
  • Why is it allowed for a base topics (possibly wrong?)
  • What about trailing dots? Are those allowed? (clarify doc)
  • Why are dots used? I saw that the docgen can replace dots with slashes. The first time I saw asyncapi I was wondering why dots are used and if I can use slashes instead. It should be more clear why dots are required and that they can be replaced by the docgen. Or 2nd option: Make dots a valid topic separator for mqtt
  • Just for my interest: Are dots used in other protocols? I've only seen slashes so far
  • Wouldnt it make sense to also add variable topics to the base topic? For example if you have a user specific API where you must call company/users/{userid}/{commands} or company/device/{serialnumber}/{commands}. That is a valid usecase I need.
@fmvilas
Copy link
Member

fmvilas commented Jul 20, 2018

This is definitely a bug in the spec. Any string can be a topic.

It's true that it would be nice to have a baseTopic with variables.

The dots were used because I started this project for AMQP (RabbitMQ). But, as I said, you should be able to use any string you want. AsyncAPI should not need to make differentiation between topic part and topic separator. That's something the tooling should take care of.

@fmvilas
Copy link
Member

fmvilas commented Feb 3, 2019

Closed in favor of #109. Thanks for reporting the bug @AtosNicoS.

@fmvilas fmvilas closed this as completed Feb 3, 2019
@fmvilas fmvilas removed the v1.3.0 label Feb 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants