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

Descriptions should be plain text (no HTML tags, no markdown tags, etc) #701

Open
Sandido opened this issue Jun 5, 2024 · 3 comments
Open
Assignees

Comments

@Sandido
Copy link
Member

Sandido commented Jun 5, 2024

Lint rule description

<br> cannot be processed by upstream Autorest and SDK doc generators and is therefore not allowed.

Related swagger example

"description": "The query option to fetch Capacity Reservation Group Resource Ids.
<br>'CreatedInSubscription' enables fetching Resource Ids for all capacity reservation group resources created in the subscription.
<br>'SharedWithSubscription' enables fetching Resource Ids for all capacity reservation group resources shared with the subscription.
<br>'All' enables fetching Resource Ids for all capacity reservation group resources shared with the subscription and created in the subscription."

Category

SDK

Severity level

Error

Applies to

Management plane API spec

How to fix the violation

Remove the <br> tags and format your text as plain text.

"description": "The query option to fetch Capacity Reservation Group Resource Ids.
'CreatedInSubscription' enables fetching Resource Ids for all capacity reservation group resources created in the subscription. 
'SharedWithSubscription' enables fetching Resource Ids for all capacity reservation group resources shared with the subscription.
'All' enables fetching Resource Ids for all capacity reservation group resources shared with the subscription and created in the subscription."

What't the impact if breaking the rule

The <br> tags will appear as plain text on all documentation and code upstream of the swagger specs (SDK, client tools). This is confusing to customers and degrades the development experience.

@mikeharder
Copy link
Member

mikeharder commented Jun 7, 2024

@Sandido: Should this be generalized to "Swagger descriptions should be plain-text"? I'm not sure there's an exact definition of what is or isn't "plain-text", but we can try to disallow common mistakes like:

  • HTML tags
  • Markdown formatting
  • URLs? Allow or deny?

Adding a rule specifically for <br> seems too narrow.

@mikeharder mikeharder self-assigned this Jun 7, 2024
@mikeharder
Copy link
Member

@Sandido: Should this be generalized to "Swagger descriptions should be plain-text"? I'm not sure there's an exact definition of what is or isn't "plain-text", but we can try to disallow common mistakes like:

  • HTML tags
  • Markdown formatting
  • URLs? Allow or deny?

Adding a rule specifically for <br> seems too narrow.

@Sandido: Ping

@mikeharder mikeharder changed the title [NoBrTags]: No <br> formatting in swagger descriptions Descriptions should be plain text (no HTML tags, no markdown tags, etc) Jun 12, 2024
@Sandido
Copy link
Member Author

Sandido commented Jun 24, 2024

@mikeharder ,
Urls seem to work fine:
https://learn.microsoft.com/en-us/dotnet/api/azure.resourcemanager.compute.models.virtualmachinehardwareprofile?view=azure-dotnet#properties

https://github.com/Azure/azure-rest-api-specs/blob/main/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/virtualMachineScaleSet.json#L3839

Html formatting is an issue as seen with the < b r >.

Based on the email thread I shared, I don't think markdown formatting is supported but haven't seen specific instances of this so I can't give a recommendation on that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants