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: add host and pathname fields in server object #329

Conversation

magicmatatjahu
Copy link
Member

Description

Add host and pathname fields in server object.

Related issue(s)
Part of asyncapi/spec#888

Copy link
Collaborator

@char0n char0n left a comment

Choose a reason for hiding this comment

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

LGTM. Nice job!

@magicmatatjahu
Copy link
Member Author

@fmvilas @char0n Thanks! However I think that we should add some regex (or format) to validate the proper host and pathname, not treat fields as normal strings. WDYT? The problem is that I will (probably) learn Regex again 😆

@char0n
Copy link
Collaborator

char0n commented Feb 8, 2023

@magicmatatjahu we theoretically can, here are the representation in pseudo context-free grammar for host and pathname.

host:

host:
      ‘[‘ ipv6-address ‘]’
      ipv4-or-reg-name

ipv6-address:
      (any input-character except ‘/’ and ‘]’)+
ipv4-or-reg-name:
      (any input-character except ‘/’, ‘:’, ‘?’ and ‘#’)+

pathname

As far as I understand this is https://url.spec.whatwg.org/#dom-url-pathname without search part

absolute-path:
      ‘/’
      (path-separator segment)+

path-separator:
      ‘/’
    
segment:
      (any input-character except ‘/’, ‘?’ and ‘#’)*

It should be possible to convert these context-free grammars into regular expressions.

@fmvilas
Copy link
Member

fmvilas commented Feb 13, 2023

@fmvilas @char0n Thanks! However I think that we should add some regex (or format) to validate the proper host and pathname, not treat fields as normal strings. WDYT? The problem is that I will (probably) learn Regex again 😆

I would create another issue for this. This is the kind of task that can quickly become a rabbithole.

@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

@magicmatatjahu
Copy link
Member Author

magicmatatjahu commented Feb 13, 2023

@fmvilas Ok, I created issue #336 I'm merging that PR, or do you want to add something?

@magicmatatjahu
Copy link
Member Author

/rtm

@asyncapi-bot asyncapi-bot merged commit ce41256 into asyncapi:next-major-spec Feb 13, 2023
@magicmatatjahu magicmatatjahu deleted the next-major/server-url-change branch February 13, 2023 12:29
@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 5.0.0-next-major-spec.11 🎉

The release is available on:

Your semantic-release bot 📦🚀

@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 6.0.0-next-major-spec.1 🎉

The release is available on:

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.

5 participants