BodyParameterComponent extends MarkupComponent<BodyParameterComponent.Parameters> { public BodyParameterComponent(Swagger2MarkupConverter.SwaggerContext context, DocumentResolver definitionDocumentResolver) { super(context); this.definitionDocumentResolver = Validate.notNull(definitionDocumentResolver, "DocumentResolver must not be null"); this.propertiesTableComponent = new PropertiesTableComponent(context, definitionDocumentResolver); } BodyParameterComponent(Swagger2MarkupConverter.SwaggerContext context,
                                  DocumentResolver definitionDocumentResolver); static BodyParameterComponent.Parameters parameters(SwaggerPathOperation operation,
                                                               List<ObjectType> inlineDefinitions); @Override MarkupDocBuilder apply(MarkupDocBuilder markupDocBuilder, Parameters params);  }
@Test public void testBodyParameterComponent() throws URISyntaxException { Path file = Paths.get(AsciidocConverterTest.class.getResource("/yaml/swagger_petstore.yaml").toURI()); Swagger2MarkupConfig config = new Swagger2MarkupConfigBuilder().withFlatBody().build(); Swagger2MarkupConverter converter = Swagger2MarkupConverter.from(file).withConfig(config).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 BodyParameterComponent(converter.getContext(), new DefinitionDocumentResolverFromOperation(context)) .apply(markupDocBuilder, BodyParameterComponent.parameters(pathOperations.get(0), new ArrayList<>())); markupDocBuilder.writeToFileWithoutExtension(outputDirectory, StandardCharsets.UTF_8); Path expectedFile = getExpectedFile(COMPONENT_NAME); DiffUtils.assertThatFileIsEqual(expectedFile, outputDirectory, getReportName(COMPONENT_NAME)); }