springdoc / springdoc.github.io

Library for OpenAPI 3 with spring-boot
https://springdoc.org
Apache License 2.0
9 stars 42 forks source link

Remove code duplication with AsciiDoc's Include Directive #73

Open codespearhead opened 6 months ago

codespearhead commented 6 months ago

As can be seen here, the documentation is duplicated across src/docs/asciidoc and src/docs/asciidoc/v1, which is not only a burden to maintain, but also runs a high risk of them going out of sync, as shown here.

The solution is to create folder src/docs/asciidoc/common and use AsciiDoc's include directive:

An include directive imports content from a separate file or URL into the content of the current document. When the current document is processed, the include directive syntax is replaced by the contents of the include file. Think of the include directive like a file expander. [Source]

/docs
├── common
├── v1
└── v2