PathOperationComponent extends MarkupComponent<PathOperationComponent.Parameters> { public PathOperationComponent(Swagger2MarkupConverter.SwaggerContext context, DocumentResolver definitionDocumentResolver, DocumentResolver securityDocumentResolver) { super(context); this.definitions = context.getSchema().getDefinitions(); this.definitionDocumentResolver = Validate.notNull(definitionDocumentResolver, "DocumentResolver must not be null"); this.propertiesTableComponent = new PropertiesTableComponent(context, definitionDocumentResolver); this.parameterTableComponent = new ParameterTableComponent(context, definitionDocumentResolver); this.consumesComponent = new ConsumesComponent(context); this.producesComponent = new ProducesComponent(context); this.securitySchemeComponent = new SecuritySchemeComponent(context, securityDocumentResolver); this.bodyParameterComponent = new BodyParameterComponent(context, definitionDocumentResolver); this.responseComponent = new ResponseComponent(context, definitionDocumentResolver); } PathOperationComponent(Swagger2MarkupConverter.SwaggerContext context,
                                  DocumentResolver definitionDocumentResolver,
                                  DocumentResolver securityDocumentResolver); static PathOperationComponent.Parameters parameters(SwaggerPathOperation operation); @Override MarkupDocBuilder apply(MarkupDocBuilder markupDocBuilder, Parameters params);  }
@Test public void testPathOperationComponent() throws URISyntaxException { String COMPONENT_NAME = "path_operation"; Path outputDirectory = getOutputFile(COMPONENT_NAME); FileUtils.deleteQuietly(outputDirectory.toFile()); Path file = Paths.get(PathOperationComponentTest.class.getResource("/yaml/swagger_petstore.yaml").toURI()); Swagger2MarkupConverter converter = Swagger2MarkupConverter.from(file).build(); Swagger swagger = converter.getContext().getSchema(); io.swagger.models.Path path = swagger.getPaths().get("/pets"); List<SwaggerPathOperation> pathOperations = PathUtils.toPathOperationsList("/pets", path); Swagger2MarkupConverter.SwaggerContext context = converter.getContext(); MarkupDocBuilder markupDocBuilder = context.createMarkupDocBuilder(); markupDocBuilder = new PathOperationComponent(context, new DefinitionDocumentResolverFromOperation(context), new SecurityDocumentResolver(context)). apply(markupDocBuilder, PathOperationComponent.parameters(pathOperations.get(0))); markupDocBuilder.writeToFileWithoutExtension(outputDirectory, StandardCharsets.UTF_8); Path expectedFile = getExpectedFile(COMPONENT_NAME); DiffUtils.assertThatFileIsEqual(expectedFile, outputDirectory, getReportName(COMPONENT_NAME)); }