{"id":16782568,"url":"https://github.com/davidmoten/openapi-to-plantuml","last_synced_at":"2025-04-06T08:13:44.480Z","repository":{"id":37079381,"uuid":"339604008","full_name":"davidmoten/openapi-to-plantuml","owner":"davidmoten","description":"Converts OpenAPI 3.0 definitions to Plant UML text for visualisation of your API.","archived":false,"fork":false,"pushed_at":"2024-10-23T17:24:59.000Z","size":6427,"stargazers_count":96,"open_issues_count":7,"forks_count":18,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-24T01:13:27.782Z","etag":null,"topics":["java","online","openapi","openapi-documentation","openapi3","plantuml","uml-diagram"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidmoten.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-17T03:47:43.000Z","updated_at":"2024-10-23T17:24:57.000Z","dependencies_parsed_at":"2023-02-10T18:15:45.995Z","dependency_job_id":"d9dc6c70-88cc-4cf2-b3fb-d5e7ce3136c2","html_url":"https://github.com/davidmoten/openapi-to-plantuml","commit_stats":null,"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidmoten%2Fopenapi-to-plantuml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidmoten%2Fopenapi-to-plantuml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidmoten%2Fopenapi-to-plantuml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidmoten%2Fopenapi-to-plantuml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidmoten","download_url":"https://codeload.github.com/davidmoten/openapi-to-plantuml/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247451665,"owners_count":20940944,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","online","openapi","openapi-documentation","openapi3","plantuml","uml-diagram"],"created_at":"2024-10-13T07:46:01.502Z","updated_at":"2025-04-06T08:13:44.462Z","avatar_url":"https://github.com/davidmoten.png","language":"Java","funding_links":[],"categories":["软件工程"],"sub_categories":["文件同步"],"readme":"# openapi-to-plantuml\n\u003ca href=\"https://github.com/davidmoten/openapi-to-plantuml/actions/workflows/ci.yml\"\u003e\u003cimg src=\"https://github.com/davidmoten/openapi-to-plantuml/actions/workflows/ci.yml/badge.svg\"/\u003e\u003c/a\u003e\u003cbr/\u003e\n[![codecov](https://codecov.io/gh/davidmoten/openapi-to-plantuml/branch/main/graph/badge.svg)](https://codecov.io/gh/davidmoten/openapi-to-plantuml)\u003cbr/\u003e\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.davidmoten/openapi-to-plantuml/badge.svg?style=flat)](https://maven-badges.herokuapp.com/maven-central/com.github.davidmoten/openapi-to-plantuml)\u003cbr/\u003e\n\nJava library to generate a [PlantUML](https://plantuml.com) Class Diagram (supplemented with path information) from an OpenAPI 3.0 definition (YAML or JSON). \n\nTry it online [here](https://openapi-to-puml.davidmoten.org/prod/site/index.html).\n\n**Features**\n\nSupports all features of OpenAPI 3.0 including\n\n* Mixed types (*oneOf*, *anyOf*, *allOf*) \n* Multiple levels of indirection (`$ref` -\u003e `$ref` for example) \n* Multiple response content types\n* Can produce diagram-per-path (great for large APIs)\n\n**Status:** Released to Maven Central \n\n**Limitations**\n\n* 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.\n\n**TODO**\n* Model *Callbacks*\n* Model *additionalProperties*\n\n[openapi-example.yml](src/test/resources/openapi-example.yml): \n\n\u003cimg style=\"background-color:white\" src=\"src/docs/openapi-example.svg\"/\u003e\n\n## How to build\n\n```bash\nmvn clean install\n```\n\n## How to quickly convert your OpenAPI definition\n\nThe easiest thing to do is to use the [online converter](https://openapi-to-puml.davidmoten.org/prod/site/index.html). If your definition is large then PlantText may refuse to render it (the Plant UML text is encoded and added to the PlantText url which can get too long). In that case just add your yaml file to `src/test/resources/demo/` directory and run `mvn test`. The generated image will be saved in `target/demos`.\n\n## Getting started\nAdd this dependency to your pom.xml:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.davidmoten\u003c/groupId\u003e\n  \u003cartifactId\u003eopenapi-to-plantuml\u003c/artifactId\u003e\n  \u003cversion\u003eVERSION_HERE\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nOr use the standalone *jar-with-dependencies* artifact from [Maven Central](https://search.maven.org/search?q=g:com.github.davidmoten%20AND%20a:openapi-to-plantuml) (or from the `target` directory if you have built the project locally):\n\n### How to produce a single diagram\n\n```bash\njava -jar openapi-to-plantuml-VERSION_HERE-jar-with-dependencies.jar single openapi.yaml PNG openapi.png\n```\nLarge diagrams are better with SVG format (rendering is sharp at every zoom level) so just replace `PNG` in the above command with `SVG`. If you still want a PNG and you find it \nis getting cut off then you need to increase the plantuml image size limit like below. Increase the limit till your diagram fits. You may need to increase memory using this JVM arg `-Xmx1024m`.\n\n```bash\njava -DPLANTUML_LIMIT_SIZE=8192 -jar openapi-to-plantuml-VERSION_HERE-jar-with-dependencies.jar openapi.yaml PNG openapi.png\n```\n\n### How to produce a diagram per service method\n\n```bash\njava -jar openapi-to-plantuml-VERSION_HERE-jar-with-dependencies.jar split openapi.yaml PNG diagrams\n```\nThe above call will write a diagram per method into the `diagrams` directory (and will create it if it doesn't exist). \n\nAs an example, do `mvn clean test` on the project and look in `target/unqork.svg` directory.\n\n## Usage\n\n```java\nimport com.github.davidmoten.oas3.puml.Converter;\n\nString puml = Converter.openApiToPuml(openapi);\n```\n\n## System properties\n* `max.enum.entries` defaults to 12. If an enum has more than the max then it will be limited to that number and an entry `...` will appear at the end of the enums.\n\n## Examples\n\nUnit test examples are [here](src/docs/generated/examples.md).\n\n[petstore-expanded.yml](src/test/resources/inputs/petstore-expanded.yml):\n\n\u003cimg src=\"src/docs/tests/petstore-expanded.puml.svg\"/\u003e\n\n[bookstore.yml](src/test/resources/demos/bookstore.yml):\n\n\u003cimg src=\"src/docs/demos/bookstore.svg\"/\u003e\n\n[ecommerce.yml](src/test/resources/demos/ecommerce.yml)\n\n\u003cimg src=\"src/docs/demos/ecommerce.svg\"/\u003e\n\n[news.yml](src/test/resources/demos/news.yml):\n\n\u003cimg src=\"src/docs/demos/news.svg\"/\u003e\n\n[strava.yml](src/test/resources/demos/strava.yml):\n\n\u003cimg src=\"src/docs/demos/strava.svg\"/\u003e\n\n[twitter.yml](src/test/resources/demos/twitter.yml):\n\n\u003cimg src=\"src/docs/demos/twitter.svg\"/\u003e\n\n[ebay.yml](src/test/resources/demos/ebay.yml):\n\n\u003cimg src=\"src/docs/demos/ebay.svg\"/\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidmoten%2Fopenapi-to-plantuml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidmoten%2Fopenapi-to-plantuml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidmoten%2Fopenapi-to-plantuml/lists"}