Missing documentation for CSharp code generator
The documentation for the CSharp generator seems to be missing some comments that would be nice to see.
- ~~#288~~
- #289
- ~~
<remarks>comments~~ - Able to specify
<exception>comments such as the AutoRest validation exception. - ~~Prefix 'gets or sets' in the comments based on the properties settings such as isReadOnly~~
- We've noticed that the other teams have 'gets or sets' in their descriptions for definitions since the 'gets or sets' comment is not being set in the model template. This will be an issue when they are generating other clients. Since the comment will not make any sense in the python client for example.
I have a fix for 5, found where the 'get or sets' prefix is generated in the model template and added this check.
@:/// <summary> @:@WrapComment("/// ", property.IsReadOnly ? "Gets " + property.Documentation.EscapeXmlComment() : "Gets or sets " + property.Documentation.EscapeXmlComment()) @:/// </summary>
This duplicates some issues that I opened quite a while ago:
https://github.com/Azure/autorest/issues/288 https://github.com/Azure/autorest/issues/289
I agree, it would be great to see these fixed. :)
@brnleehng We should remove your (1) and (2) and just edit this to refer to the issues opened by @brjohnstmsft there instead. I think your (3), (4), and (5) still apply.
@tbombach @markcowl @hovsepm @brjohnstmsft I am working on solving number 3 above.
Are you okay with the following?
On operations: "summary" maps to <summary> (it already does this actually, just including it for completeness)
On models: "title" maps to <summary>, and if "title" is not specified, then "description" gets promoted to <summary> instead, to avoid breaking existing client documentation patterns which have "description" being used as the <summary> tag everywhere.
Alright, see: #1163 for fix to item 3 (support of remarks)
Items 3 and 5 are now fixed. I believe @brjohnstmsft also has fixed item 2 for CSharp
I fixed item 1, not item 2.
Just looping around on issues that we wanted to get cleaned up.
@brjohnstmsft Kinda curious what you were thinking with 4 - ' Able to specify
You wanted to be able to put text in the swagger for what shows up in <exception>...</exception> ?
That's kinda specific to c# -- and if that's the case, we're going to have to wait on that for some work we're looking into for per-language-specific settings so we can keep swagger clean.
@fearthecowboy That proposal was from @brnleehng, not me
@brnleehng Was probably just proxying me on that one =P
The intent is as follows:
- We know that we raise certain validation exceptions, so we should include those in a
<exception>(in C#) or araisesin Python probably. - This also applies to custom exception types defined in the
defaultcategory -- AutoRest knows that a particular operationsdefaultthrows aBatchErrorException, then it might as well put that in the<exception>orrasiessection.
Note: Other languages probably have their equivilant of raises/<exception> too.
IIRC, we do spit out <execption>s now.
@fearthecowboy -- Long time coming but just wanted to confirm that you do indeed output the exception details now. Thanks!
It looks like the only remaining issue here is 2, which is also being tracked here: #289, so I think you can close this issue now.