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

Documentation for operation groups #289

Closed
brjohnstmsft opened this issue Aug 6, 2015 · 7 comments
Closed

Documentation for operation groups #289

brjohnstmsft opened this issue Aug 6, 2015 · 7 comments
Assignees

Comments

@brjohnstmsft
Copy link
Member

Currently there is no place in Swagger specs to add documentation for enum labels or operation groups. The end result is missing documentation in the generated code. For example, the operation group property ISearchManagementClient.Services used to have a comment and URL that referred to the corresponding section of the REST API docs on MSDN, but there is no home for this documentation in the Swagger spec.

Our users deserve awesome docs. We should consider a Swagger extension for adding documentation for operation groups and enum labels (also URL references; see related issue: #288).

@devigned
Copy link
Member

devigned commented Aug 6, 2015

Hmm... why not have the documentation contain the markdown content that would be displayed in MSDN?

@brjohnstmsft
Copy link
Member Author

But where would it go? You can't attach documentation to enum labels or operation groups anymore. For example, here is how the C# code for a simple enum used to look before AutoRest:

/// <summary> 
/// Defines the SKU of an Azure Search Service, which determines price tier 
/// and capacity limits. 
/// </summary> 
public enum SkuType 
{ 
    /// <summary> 
    /// Indicates a free Search service. 
    /// </summary> 
    Free = 0, 

    /// <summary> 
    /// Indicates a standard Search service with dedicated resources. 
    /// </summary> 
    Standard = 1, 

    /// <summary> 
    /// Indicates a dedicated search service with additional capacity for 
    /// higher throughput and storage. Use only under the guidance of 
    /// Microsoft support.  (see 
    /// http://azure.microsoft.com/pricing/details/search/ for more 
    /// information) 
    /// </summary> 
    Standard2 = 2, 
} 

Here is how it looks with AutoRest:

/// <summary>
/// Defines values for SkuType.
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum SkuType
{
    [EnumMember(Value = "free")]
    Free,
    [EnumMember(Value = "standard")]
    Standard,
    [EnumMember(Value = "standard2")]
    Standard2
}

The missing /// comments mean missing documentation when it gets published to MSDN, and also missing Intellisense tooltips in Visual Studio. The docs are missing because they're not in the Swagger spec (because there's nowhere in the Swagger spec to put them).

@brjohnstmsft
Copy link
Member Author

Here's the relevant Swagger discussion for documenting enum labels: OAI/OpenAPI-Specification#348

@henkosch
Copy link

henkosch commented Oct 1, 2015

+1

@matthchr
Copy link
Member

matthchr commented Jun 2, 2016

+1 to this

@fearthecowboy fearthecowboy self-assigned this Jun 15, 2016
@fearthecowboy fearthecowboy modified the milestones: 1.0, Icebox Jun 15, 2016
@olydis
Copy link
Contributor

olydis commented Jun 1, 2017

Documentation for enum values is a thing now as such:

x-ms-enum:
  name: <name for generated type>
  modelAsString: true|false
  values:  <array of one or more enum-values:>
    - value: <wire-value>
      description: <description of that value>
      name: <generated enum member name (defaults to ‘value’)>

It was implemented by #2308

I've changed the title of this issue accordingly.

@olydis olydis changed the title Documentation for enums and operation groups Documentation for operation groups Jun 1, 2017
@fearthecowboy fearthecowboy removed this from the 1.0 milestone Jun 22, 2017
@fearthecowboy
Copy link
Member

Adding operation group docs to vNext design

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

No branches or pull requests

7 participants