Skip to content

Commit

Permalink
importer-msgraph-metadata: set descriptions for operations
Browse files Browse the repository at this point in the history
  • Loading branch information
manicminer committed Aug 18, 2024
1 parent 15d19aa commit ff06c4f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type Resource struct {

type Operation struct {
Name string
Description string
Type OperationType
Method string
ResourceId *ResourceId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,17 @@ func (p pipelineForService) parseResources(resourceIds parser.ResourceIds, model
}
}

operationDescription := make([]string, 0)
if operation.Summary != "" {
operationDescription = append(operationDescription, operation.Summary)
}
if operation.Description != "" {
operationDescription = append(operationDescription, operation.Description)
}

resources[resourceName].Operations = append(resources[resourceName].Operations, parser.Operation{
Name: operationName,
Description: strings.Join(operationDescription, ". "),
Type: operationType,
Method: method,
ResourceId: resourceId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ func (p pipelineForService) translateServiceToDataApiSdkTypes() (*sdkModels.Serv

sdkService.APIVersions[resource.Version].Resources[resource.Category].Operations[operation.Name] = sdkModels.SDKOperation{
ContentType: contentType,
Description: operation.Description,
ExpectedStatusCodes: expectedStatusCodes,
FieldContainingPaginationDetails: operation.PaginationField,
LongRunning: false,
Expand Down

0 comments on commit ff06c4f

Please sign in to comment.