AsyncApi doc genearation without root tag
Now my generation document on http://localhost:8086/springwolf/docs is:
{ "myproject": { "asyncapi": "2.2.0" "info": { .... } ...... } }
The root node's "myproject" name is from part of AsyncApiConfig:
@Bean
public AsyncApiDocket asyncApiDocket() {
Info info = Info.builder()
.version("1.0.0")
.title("myproject")
.build();
If I set title to null, NullPointerException hapens.
When i try to generate client schema by AsyncApi generator
# ag http://localhost:8086/springwolf/docs @asyncapi/java-spring-template
I get the error:
Something went wrong:
Error: The `asyncapi` field is missing.
at parse (/usr/local/lib/node_modules/@asyncapi/generator/node_modules/@asyncapi/parser/lib/parser.js:72:13)
at Generator.generateFromString (/usr/local/lib/node_modules/@asyncapi/generator/lib/generator.js:265:28)
at Generator.generateFromURL (/usr/local/lib/node_modules/@asyncapi/generator/lib/generator.js:298:17)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at /usr/local/lib/node_modules/@asyncapi/generator/cli.js:156:9
In the code of parser.js exception happens if there is no field "asyncapi" in Json (at first level). How can I generate the asyncapi document without root project title tag?
Thanks for reporting thus issue!
This behavior is intentional, but I realize now that it may interrupt flows like yours.
I think the more reasonable solution here will be to return the valid asyncapi doc directly from http://localhost:8086/springwolf/docs.
I make the change and then close this issue.
Thanks much for response and project! I had mistake in my message (in asyncApiDocket method), i fixed it, the title now is "myproject"
Resolved in https://github.com/springwolf/springwolf-core/pull/75
Finally fixed, will be available in the next release (will require ui update)