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

fix: escape < > symbols #542

Merged
merged 32 commits into from
Apr 18, 2024
Merged

fix: escape < > symbols #542

merged 32 commits into from
Apr 18, 2024

Conversation

korifey91
Copy link
Contributor

Description

In order to allow different tools to correctly show array|tuple types of properties in schema we need to escape special symbols - <, >.

Related issue(s)
Fixes #365

korifey91 added 28 commits April 1, 2024 11:53
# Conflicts:
#	package-lock.json
@korifey91
Copy link
Contributor Author

/ptal

@asyncapi-bot
Copy link
Contributor

@fmvilas @derberg @magicmatatjahu Please take a look at this PR. Thanks! 👋

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.

that was fast

I think escaping work with one slash, not 2, cause then you see of of the slashes in rendered markdown

| Name | Type | Description | Value | Constraints | Notes |
|---|---|---|---|---|---|
| (root) | array\\<string\\> | - | - | [ 1 .. 5 ] unique items | - |

renders below
Screenshot 2024-04-18 at 12 16 16

why not choosing to simply add code block as the person that reported the issue wanted, so

| Name | Type | Description | Value | Constraints | Notes |
|---|---|---|---|---|---|
| (root) | `array<string>` | - | - | [ 1 .. 5 ] unique items | - |

that renders event better

Screenshot 2024-04-18 at 12 17 27

or

| Name | Type | Description | Value | Constraints | Notes |
|---|---|---|---|---|---|
| (root) | array&lt;string&gt; | - | - | [ 1 .. 5 ] unique items | - |

that also works

Screenshot 2024-04-18 at 12 18 41

@korifey91
Copy link
Contributor Author

that was fast

I think escaping work with one slash, not 2, cause then you see of of the slashes in rendered markdown

| Name | Type | Description | Value | Constraints | Notes |
|---|---|---|---|---|---|
| (root) | array\\<string\\> | - | - | [ 1 .. 5 ] unique items | - |

renders below Screenshot 2024-04-18 at 12 16 16

why not choosing to simply add code block as the person that reported the issue wanted, so

| Name | Type | Description | Value | Constraints | Notes |
|---|---|---|---|---|---|
| (root) | `array<string>` | - | - | [ 1 .. 5 ] unique items | - |

that renders event better

Screenshot 2024-04-18 at 12 17 27

or

| Name | Type | Description | Value | Constraints | Notes |
|---|---|---|---|---|---|
| (root) | array&lt;string&gt; | - | - | [ 1 .. 5 ] unique items | - |

that also works

Screenshot 2024-04-18 at 12 18 41

I think codeblocks is not the best choice, because we will have different visual formatting for types and lose consistency.

But &lt; and &gt; seems a good fit.

P.S. It seems me IDE problem. I tryied to use one escape, but md looked wrong(like I change nothing).

1 similar comment
@korifey91
Copy link
Contributor Author

that was fast

I think escaping work with one slash, not 2, cause then you see of of the slashes in rendered markdown

| Name | Type | Description | Value | Constraints | Notes |
|---|---|---|---|---|---|
| (root) | array\\<string\\> | - | - | [ 1 .. 5 ] unique items | - |

renders below Screenshot 2024-04-18 at 12 16 16

why not choosing to simply add code block as the person that reported the issue wanted, so

| Name | Type | Description | Value | Constraints | Notes |
|---|---|---|---|---|---|
| (root) | `array<string>` | - | - | [ 1 .. 5 ] unique items | - |

that renders event better

Screenshot 2024-04-18 at 12 17 27

or

| Name | Type | Description | Value | Constraints | Notes |
|---|---|---|---|---|---|
| (root) | array&lt;string&gt; | - | - | [ 1 .. 5 ] unique items | - |

that also works

Screenshot 2024-04-18 at 12 18 41

I think codeblocks is not the best choice, because we will have different visual formatting for types and lose consistency.

But &lt; and &gt; seems a good fit.

P.S. It seems me IDE problem. I tryied to use one escape, but md looked wrong(like I change nothing).

Copy link
Member

derberg commented Apr 18, 2024

ok, then lets be on the safe side and use what works, which is &lt; and &gt;

@korifey91
Copy link
Contributor Author

@derberg Could you take a look again?

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.

perfect work, thanks a 💯 !

Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@derberg
Copy link
Member

derberg commented Apr 18, 2024

/rtm

@derberg derberg self-requested a review April 18, 2024 12:25
@asyncapi-bot asyncapi-bot merged commit 67e0cf3 into asyncapi:master Apr 18, 2024
10 checks passed
@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 1.6.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.

Output contain valid XML tags
3 participants