Sha256: 5676e882b817ba49a8c1b83e366a18aa6363d2d0c92977a34243ed999b8f7513
Contents?: true
Size: 1.19 KB
Versions: 15
Compression:
Stored size: 1.19 KB
Contents
module OasRails module Builders class OperationBuilder include Extractors::OasRouteExtractor def initialize(specification) @specification = specification @operation = Spec::Operation.new(specification) end def from_oas_route(oas_route) @operation.summary = extract_summary(oas_route:) @operation.operation_id = extract_operation_id(oas_route:) @operation.description = oas_route.docstring @operation.tags = extract_tags(oas_route:) @operation.security = extract_security(oas_route:) @operation.parameters = ParametersBuilder.new(@specification).from_oas_route(oas_route).build @operation.request_body = RequestBodyBuilder.new(@specification).from_oas_route(oas_route).reference @operation.responses = ResponsesBuilder.new(@specification) .from_oas_route(oas_route) .add_autodiscovered_responses(oas_route) .add_default_responses(oas_route, !@operation.security.empty?).build self end def build @operation end end end end
Version data entries
15 entries across 15 versions & 1 rubygems