1.6.0 • Published 11 days ago

@floevcharging/asyncapi-java-dapr-template v1.6.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
11 days ago

Overview

This template generates an HTML page with an overview of the data model provided in your AsyncAPI file. Its core part is the diagram showing relations between the data model. Except for HTML, you can also generate a PDF file from the HTML page or get the diagram into a separate PNG and SVG.

Technical requirements

Specification requirements

The table contains information on parts of the specification required by this template to generate the proper output.

Property nameReasonFallbackDefault
components.schemasThis template supports only schemas that have unique and human-readable names. Such names can also be provided if schemas are described under components.schemas and each schema is a separate object with its unique key.--

Supported protocols

This template doesn't generate code and therefore is not limited to any specific protocols.

How to use the template

This template must be used with the AsyncAPI Generator. You can find all available options here.

CLI

npm install -g @asyncapi/generator
ag https://raw.githubusercontent.com/asyncapi/generator/v1.0.1/test/docs/dummy.yml https://github.com/asyncapi/template-for-generator-templates -o output
open output/index.html

Docker

docker run --rm -it \
-v ${PWD}/output:/app/output \
asyncapi/generator -o /app/output https://raw.githubusercontent.com/asyncapi/generator/v1.0.1/test/docs/dummy.yml https://github.com/asyncapi/template-for-generator-templates --force-write

Template configuration

You can configure this template by passing different parameters in the Generator CLI: -p PARAM1_NAME=PARAM1_VALUE -p PARAM2_NAME=PARAM2_VALUE

NameDescriptionRequiredDefaultAllowed ValuesExample
asyncapiFileDirCustom location of the AsyncAPI file that you provided as an input in a generation.NoThe root of the output directory.Path to the custom directory relative to the root of output directory provided as a string./custom/dir
pdfGenerates PDF from initially generated HTML file.Nofalsetrue/falsetrue
pngGenerates PNG with a schemas relations diagram.Nofalsetrue/falsetrue
svgGenerates SVG with a schemas relations diagram.Nofalsetrue/falsetrue
maxTextSizeIt is possible that if an AsyncAPI document is extremely large, the default mermaid recommended text size will not be enough. In such a case, you need to configure it explicitly.No50000A number higher than 5000070000

Custom hooks that you can disable

The functionality of this template is extended with different hooks that you can disable like this in the Generator CLI: -d HOOK_TYPE1=HOOK_NAME1,HOOK_NAME2 -d HOOK_TYPE2

TypeNameDescription
generate:aftercreateAsyncapiFileIt creates AsyncAPI file with content of the spec file passed to the generator

Development

The most straightforward command to use this template is:

ag https://raw.githubusercontent.com/asyncapi/generator/v1.0.1/test/docs/dummy.yml https://github.com/asyncapi/template-for-generator-templates -o output

For local development, you need different variations of this command. First of all, you need to know about three important CLI flags:

  • --debug enables the debug mode in Nunjucks engine what makes filters debugging simpler.
  • --watch-template enables a watcher of changes that you make in the template. It regenerates your template whenever it detects a change.
  • --install enforces reinstallation of the template.

There are two ways you can work on template development:

  • Use global Generator and template from your local sources:
    # assumption is that you run this command from the root of your template
    ag https://raw.githubusercontent.com/asyncapi/generator/v1.0.1/test/docs/dummy.yml ./ -o output
  • Use Generator from sources and template also from local sources. This approach enables more debugging options with awesome console.log in the Generator sources or even the Parser located in node_modules of the Generator:
    # assumption is that you run this command from the root of your template
    # assumption is that generator sources are cloned on the same level as the template
    ../generator/cli.js https://raw.githubusercontent.com/asyncapi/generator/v1.0.1/test/docs/dummy.yml ./ -o output

Contributors

1.6.0

11 days ago

1.5.1

2 months ago

1.5.0

3 months ago

1.2.0

9 months ago

1.1.1

9 months ago

1.1.0

9 months ago

1.0.9

10 months ago

1.3.5

8 months ago

1.0.8

10 months ago

1.3.4

8 months ago

1.0.7

10 months ago

1.3.3

8 months ago

1.4.1

6 months ago

1.3.2

8 months ago

1.4.0

6 months ago

1.3.1

8 months ago

1.3.0

8 months ago

1.0.11

9 months ago

1.0.10

10 months ago

1.0.12

9 months ago

1.0.6

10 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago