Skip to content

Simple API specs make swagger2markup crash #17

@gganssauge

Description

@gganssauge

I'm starting with a very simple API to build up my microservice toolchain.

One step of that toolchain is generation of markdown from the swagger spec for my API.

Swagger2Markup seems to be the best option to realize such a step.

Unfortunately Swagger2Markup crashes on my API:

(gotti@plattfisch 644) java -jar swagger2markup-cli-1.3.1.jar convert -i api.yaml -f fred.md
16:56:01.057 [main] INFO  io.swagger.parser.Swagger20Parser - reading from /home/gotti/source/aurora/git/microservices/server/aurora.microservice.usersettings/api/api.yaml
16:56:01.410 [main] DEBUG i.g.s.i.document.PathsDocument - Generate examples is disabled.
16:56:01.410 [main] DEBUG i.g.s.i.document.PathsDocument - Create separated operation files is disabled.
16:56:01.411 [main] DEBUG i.g.s.i.document.DefinitionsDocument - Create separated definition files is disabled.
16:56:01.594 [main] INFO  i.g.s.m.b.i.asciidoc.AsciiDocBuilder - Markup document written to: /home/gotti/source/aurora/git/microservices/server/aurora.microservice.usersettings/api/fred.md.adoc
16:56:01.684 [main] DEBUG i.g.s.i.document.PathsDocument - Operation processed : 'getUserConfig' (normalized id = 'getUserConfig')
16:56:01.714 [main] DEBUG i.g.s.i.document.PathsDocument - Operation processed : 'saveUserConfig' (normalized id = 'saveUserConfig')
16:56:01.732 [main] DEBUG i.g.s.i.document.PathsDocument - Operation processed : 'deleteUserConfig' (normalized id = 'deleteUserConfig')
16:56:01.733 [main] INFO  i.g.s.m.b.i.asciidoc.AsciiDocBuilder - Markup document written to: /home/gotti/source/aurora/git/microservices/server/aurora.microservice.usersettings/api/fred.md.adoc
16:56:01.733 [main] INFO  i.g.s.m.b.i.asciidoc.AsciiDocBuilder - Markup document written to: /home/gotti/source/aurora/git/microservices/server/aurora.microservice.usersettings/api/fred.md.adoc
Exception in thread "main" java.lang.IllegalArgumentException: cells must not be null
        at org.apache.commons.lang3.Validate.notEmpty(Validate.java:300)
        at io.github.swagger2markup.markup.builder.internal.asciidoc.AsciiDocBuilder.tableWithColumnSpecs(AsciiDocBuilder.java:213)
        at io.github.swagger2markup.internal.component.TableComponent.apply(TableComponent.java:66)
        at io.github.swagger2markup.internal.component.SecuritySchemeDefinitionComponent.buildSecurityScheme(SecuritySchemeDefinitionComponent.java:106)
        at io.github.swagger2markup.internal.component.SecuritySchemeDefinitionComponent.apply(SecuritySchemeDefinitionComponent.java:64)
        at io.github.swagger2markup.internal.document.SecurityDocument.lambda$buildSecuritySchemeDefinitionsSection$0(SecurityDocument.java:75)
        at java.util.LinkedHashMap.forEach(LinkedHashMap.java:684)
        at io.github.swagger2markup.internal.document.SecurityDocument.buildSecuritySchemeDefinitionsSection(SecurityDocument.java:74)
        at io.github.swagger2markup.internal.document.SecurityDocument.apply(SecurityDocument.java:61)
        at io.github.swagger2markup.Swagger2MarkupConverter.applySecurityDocument(Swagger2MarkupConverter.java:209)
        at io.github.swagger2markup.Swagger2MarkupConverter.toFile(Swagger2MarkupConverter.java:242)
        at io.github.swagger2markup.cli.Application.run(Application.java:84)
        at io.github.swagger2markup.cli.Application.main(Application.java:61)
(gotti@plattfisch 645)

When I omit the SecurityDefinition the generation that crash doesn't happen and an output file is created.

I attached the API spec used to generate the above crash, so it is possible to reproduce the error.

api.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions