示例#1
0
        public static DslResponse GetResponse(this DslOperation operation, string statusCode, string description = null)
        {
            if (!operation.Operation.Responses.TryGetValue(statusCode, out var response))
            {
                response = new OpenApiResponse
                {
                    Description = description,
                };
                operation.Operation.Responses.Add(statusCode, response);
            }

            response.Description = description;
            return(new DslResponse(operation, response));
        }
 internal DslResponse(DslOperation operation, OpenApiResponse response)
 {
     Operation = operation;
     Response  = response;
 }