Пример #1
0
        private Operation CreateGetOperation(SwaggerPathsResource swaggerResource)
        {
            var operation = new Operation
            {
                tags = new List <string>
                {
                    SwaggerDocumentHelper.GetResourcePluralName(swaggerResource.Resource)
                    .ToCamelCase()
                },
                summary     = "Retrieves specific resources using the resource's property values (using the \"Get\" pattern).",
                description =
                    "This GET operation provides access to resources using the \"Get\" search pattern.  The values of any properties of the resource that are specified will be used to return all matching results (if it exists).",
                operationId = swaggerResource.OperationId ?? $"get{swaggerResource.Resource.PluralName}",
                deprecated  = swaggerResource.IsDeprecated,
                produces    = new[] { _contentTypeStrategy.GetOperationContentType(swaggerResource, ContentTypeUsage.Readable) },
                parameters  = CreateGetByExampleParameters(swaggerResource),
                responses   = SwaggerDocumentHelper.GetReadOperationResponses(
                    _pathsFactoryNamingStrategy.GetResourceName(swaggerResource, ContentTypeUsage.Readable), true)
            };

            return(operation);
        }