Azure / autorest.go

Extension for AutoRest (https://github.com/Azure/autorest) that generates Go code
MIT License
69 stars 43 forks source link

Parsing comments strips things that look like HTML elements #623

Open jhendrixMSFT opened 3 years ago

jhendrixMSFT commented 3 years ago

In transform.ts:parseComments(), the conversion to HTML then text can strip some content that appears to be HTML tags.

E.g. in additionalProperties.json in the test server, the description "Dictionary of " is munged into "Dictionary of ".

chamons commented 3 years ago

I'm not sure that this is due to comment HTML parsing. If I dump the code-mode-v4.yaml I see:

      language:
        default:
          name: PetAPTrue
          description: Dictionary of <any>
        go:
          name: PetAPTrue
          description: Dictionary of
          elementIsPtr: false
          marshallingFormat: json

where Go's description is cut off.

chamons commented 3 years ago

If I run this against C#, the yaml contains:

      language: !Languages 
        default:
          name: PetAPTrue
          description: Dictionary of <any>
chamons commented 3 years ago

Here are both code models, though we are just parsing additionalProperties from testserver.

CodeModels.zip

chamons commented 3 years ago

Raised to autorest core for research - https://github.com/Azure/autorest/issues/4233

chamons commented 3 years ago

Turns out to be https://github.com/Azure/autorest.go/blob/9bd1767fe956123857b574060110e688f137a2ee/src/transform/transform.ts#L44