Git Product home page Git Product logo

openapi-to-plantuml's People

Contributors

davidmoten avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

openapi-to-plantuml's Issues

openapi uml generation error

Hi @davidmoten
I tried to build uml for 5gc openapis. I built openapi-to-plantuml first.
Then I run inside 5gc open api folder -> https://github.com/jdegre/5GC_APIs.git. but I get below error.
Am I doing in correct way ?

5GC_APIs$ java -jar openapi-to-plantuml/target/openapi-to-plantuml-0.1.9-SNAPSHOT-jar-with-dependencies.jar  TS29531_Nnssf_NSSelection.yaml PNG openapi.png11
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "main" java.lang.RuntimeException: could not find ref=./TS29571_CommonData.yaml#/components/schemas/NfInstanceId
	at com.github.davidmoten.oas3.internal.Names.refToClassName(Names.java:94)
	at com.github.davidmoten.oas3.internal.Common.getUmlTypeName(Common.java:285)
	at com.github.davidmoten.oas3.internal.Common.getUmlTypeName(Common.java:279)
	at com.github.davidmoten.oas3.internal.Common.getUmlTypeName(Common.java:302)
	at com.github.davidmoten.oas3.internal.Common.getUmlTypeName(Common.java:279)
	at com.github.davidmoten.oas3.internal.Common.lambda$toModelClass$1(Common.java:120)
	at java.base/java.util.LinkedHashMap$LinkedEntrySet.forEach(LinkedHashMap.java:671)
	at com.github.davidmoten.oas3.internal.Common.toModelClass(Common.java:81)
	at com.github.davidmoten.oas3.internal.ComponentsHelper.lambda$toModel$0(ComponentsHelper.java:24)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
	at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
	at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.reduce(ReferencePipeline.java:553)
	at com.github.davidmoten.oas3.internal.ComponentsHelper.toModel(ComponentsHelper.java:26)
	at com.github.davidmoten.oas3.puml.Converter.openApiToPuml(Converter.java:62)
	at com.github.davidmoten.oas3.puml.Converter.openApiToPuml(Converter.java:55)
	at com.github.davidmoten.oas3.puml.Converter.openApiToPuml(Converter.java:41)
	at com.github.davidmoten.oas3.puml.Converter.openApiToPuml(Converter.java:46)
	at com.github.davidmoten.oas3.puml.ConverterMain.main(ConverterMain.java:42)
5GC_APIs$ 
5GC_APIs$ 
5GC_APIs$ ls | grep TS29571_CommonData.yaml
TS29571_CommonData.yaml

Required Runtime libraries

The jar with dependencies is 29 MB and most POM listed dependencies are large size too. For example guava-31.0.1-android.jar is itself close to 3 MB in size. What are the jar files that are absolutely required to embed in another application to run and generate the puml from swagger.

Half of the diagram is missing if you have a big *.yaml source file

First, I would like to mention that this is a really nice tool, I like it so much.
Recently I have found a bug in it. Please see the details below.

I use the following command to generate the PNG:
java -jar openapi-to-plantuml-0.1.20-jar-with-dependencies.jar my-api.yaml PNG my-api.png

Unfortunately, my *.yaml is quite huge and the generated image dimension is not big enough to show the whole picture.

I uploaded the result (image) here and you can check it.

The yaml file we have is not public so I can not share it on the internet but I can send it to you in a private channel but you are not allowed to share/publish it.

Could you please fix this issue?
Thanks.

Make it runnable headless for CI

Hello,

First, thanks for this wonderful work :)

I would like to run it on CI to allow people to make some beautiful PlantUML pictures from OpenAPI specifications, but I face the following issue :

Exception in thread "main" java.awt.AWTError: Can't connect to X11 window server using 'localhost:0.0' as the value of the DISPLAY variable.
        at java.desktop/sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
        at java.desktop/sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:102)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.desktop/sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:61)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:315)
        at java.desktop/java.awt.GraphicsEnvironment$LocalGE.createGE(GraphicsEnvironment.java:101)
        at java.desktop/java.awt.GraphicsEnvironment$LocalGE.<clinit>(GraphicsEnvironment.java:83)
        at java.desktop/java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:129)
        at java.desktop/java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1181)
        at net.sourceforge.plantuml.FileFormat.<clinit>(FileFormat.java:126)
        at com.github.davidmoten.oas3.puml.ConverterMain.main(ConverterMain.java:36)

Is there a simple way to run it without X11 installed or is it necessary to adapt the code ?

Thanks in advance

Nico

Hitting a NullPointerException while creating UML

I am running into the following exception when trying to convert a JSON Swagger structure

[ERROR] java.lang.NullPointerException
java.lang.NullPointerException: null
at com.github.davidmoten.oas3.internal.PathsHelper.toModelParameter(PathsHelper.java:130) ~[openapi-to-plantuml-0.1.12-SNAPSHOT.jar:?]
at com.github.davidmoten.oas3.internal.PathsHelper.lambda$toModelParameters$4(PathsHelper.java:76) ~[openapi-to-plantuml-0.1.12-SNAPSHOT.jar:?]
at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) ~[?:1.8.0_221]
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source) ~[?:1.8.0_221]
at java.util.stream.AbstractPipeline.copyInto(Unknown Source) ~[?:1.8.0_221]
at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) ~[?:1.8.0_221]
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source) ~[?:1.8.0_221]
at java.util.stream.AbstractPipeline.evaluate(Unknown Source) ~[?:1.8.0_221]
at java.util.stream.ReferencePipeline.reduce(Unknown Source) ~[?:1.8.0_221]
at com.github.davidmoten.oas3.internal.PathsHelper.toModelParameters(PathsHelper.java:77) ~[openapi-to-plantuml-0.1.12-SNAPSHOT.jar:?]
at com.github.davidmoten.oas3.internal.PathsHelper.lambda$toModelPath$2(PathsHelper.java:62) ~[openapi-to-plantuml-0.1.12-SNAPSHOT.jar:?]
at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) ~[?:1.8.0_221]
at java.util.Iterator.forEachRemaining(Unknown Source) ~[?:1.8.0_221]
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Unknown Source) ~[?:1.8.0_221]
at java.util.stream.AbstractPipeline.copyInto(Unknown Source) ~[?:1.8.0_221]
at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) ~[?:1.8.0_221]
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source) ~[?:1.8.0_221]
at java.util.stream.AbstractPipeline.evaluate(Unknown Source) ~[?:1.8.0_221]
at java.util.stream.ReferencePipeline.reduce(Unknown Source) ~[?:1.8.0_221]
at com.github.davidmoten.oas3.internal.PathsHelper.toModelPath(PathsHelper.java:69) ~[openapi-to-plantuml-0.1.12-SNAPSHOT.jar:?]
at com.github.davidmoten.oas3.internal.PathsHelper.lambda$paths$0(PathsHelper.java:47) ~[openapi-to-plantuml-0.1.12-SNAPSHOT.jar:?]
at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) ~[?:1.8.0_221]
at java.util.Iterator.forEachRemaining(Unknown Source) ~[?:1.8.0_221]
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Unknown Source) ~[?:1.8.0_221]
at java.util.stream.AbstractPipeline.copyInto(Unknown Source) ~[?:1.8.0_221]
at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) ~[?:1.8.0_221]
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source) ~[?:1.8.0_221]
at java.util.stream.AbstractPipeline.evaluate(Unknown Source) ~[?:1.8.0_221]
at java.util.stream.ReferencePipeline.reduce(Unknown Source) ~[?:1.8.0_221]
at com.github.davidmoten.oas3.internal.PathsHelper.paths(PathsHelper.java:49) ~[openapi-to-plantuml-0.1.12-SNAPSHOT.jar:?]
at com.github.davidmoten.oas3.internal.PathsHelper.toModel(PathsHelper.java:37) ~[openapi-to-plantuml-0.1.12-SNAPSHOT.jar:?]
at com.github.davidmoten.oas3.puml.Converter.openApiToPuml(Converter.java:65) ~[openapi-to-plantuml-0.1.12-SNAPSHOT.jar:?]
at com.github.davidmoten.oas3.puml.Converter.openApiToPuml(Converter.java:57) ~[openapi-to-plantuml-0.1.12-SNAPSHOT.jar:?]

The Swagger structure is as below.

{
"swagger" : "2.0",
"info" : {
"version" : "1.0",
"title" : "Summary about the new REST service.",
"description" : "Summary about the new REST service."
},
"host" : "localhost:8089",
"basePath" : "/",
"schemes" : [ "http" ],
"paths" : {
"/profiles" : {
"get" : {
"description" : "",
"operationId" : "get-profiles",
"consumes" : [ "application/json" ],
"produces" : [ "application/json" ],
"parameters" : [ {
"name" : "UUID",
"in" : "query",
"description" : "",
"type" : "string",
"required" : false
} ],
"responses" : {
"200" : {
"description" : "a Profile to be returned",
"schema" : {
"$ref" : "#/definitions/Profile"
}
}
}
}
}
},
"definitions" : {
"Profile" : {
"type" : "object",
"required" : [ "PROFILE_ID", "UUID", "PHOTO_FILE_TYPE", "PHOTO_UPD_DT", "PHOTO" ],
"properties" : {
"UUID" : {
"type" : "string"
},
"PROFILE_ID" : {
"type" : "string"
},
"PHOTO" : {
"type" : "string"
},
"PHOTO_FILE_TYPE" : {
"type" : "string"
},
"PHOTO_UPD_DT" : {
"type" : "string"
}
}
}
}
}

Multi Level Direction

Limitations:
Only handles internal references ("#/*"), that is the yaml file should be self-contained. As of 0.1.9 external refs are displayed but not exploded. Full external reference support is being considered.

Dear creator,
I need this feature and would like to enable it.
What do you need in order to make it possible. I haven't taken the time to work into the code and create a new branch with that feature.
Are you working on it yourself?

Thank you for your great work :)

Gradle plugin

Creation of a Gradle plugin of an Gradle plugin, will enable an integration of the workflow of building the services and the documentation

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.