Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

WARN in asciidoc logs while generating asciidoctor #326

Closed
fkalinowski opened this issue May 15, 2019 · 0 comments · Fixed by #327
Closed

WARN in asciidoc logs while generating asciidoctor #326

fkalinowski opened this issue May 15, 2019 · 0 comments · Fixed by #327

Comments

@fkalinowski
Copy link
Contributor

fkalinowski commented May 15, 2019

Hi,

Here is a problem I've got with the version 1.0.15 and it's has been verified with the spring-restdocs@1.2.6.RELEASE

Description

I've got some WARN log entries while generating the asciidoc version of the documentation.

[INFO] --- asciidoctor-maven-plugin:1.6.0:process-asciidoc (asciidoc-generate) @ my-project
...
[INFO] ... skipping reference to missing attribute: reference
[INFO] ... skipping reference to missing attribute: reference
[INFO] ... skipping reference to missing attribute: id
...

Potential solution

The problem seems to be the same than an issue reported in the Spring Rest Doc project see spring-projects/spring-restdocs#527 which has been solved by the commit spring-projects/spring-restdocs@e14bda0.

Based on the issue above and the implemented solution, the template default-auto-method-path.snippet should be modified to make sure the path of the REST API is surrounded by + ... + which in turn will guarantee a pass-through of the whole string (see AsciiDoctor > Syntax quick reference.

IMHO, this problem impacts both maintained versions 1.0.15 and 2.0.5.

My proposed solution only fixes my problem, the escaping of {} can be required in other parts of this project - I ddn't check the whole codebase.

Workaround

As stated in the Spring Rest Doc documentation it is possible to override the default templates by providing a file named auto-method-path.snippet in the folder src\test\resources\org\springframework\restdocs\templates\asciidoctor for which the content is:

`+{{method}} {{path}}+`
jmisur pushed a commit that referenced this issue May 27, 2019
…ddpoint (#328)

* Disable interpolation of Asciidoctor for the path part of the Rest Endpoint

Previously, when generating Asciidoctor snipppets, based on this template, the path parameter was interpolated.
This was considered by Asciidoctor as an attributes which are typically surrounded by { and }. 

This commit surrounds the path with + characters which disables all interpolation.

Closes #326

* Review unit test after having surrounded the content of 'default-auto-method-path.snippet' with a '+' to avoid interpolating path variables

Closes #326
jmisur pushed a commit that referenced this issue May 27, 2019
…point (#327)

* Disable interpolation of Asciidoctor for the path part of the Rest Endpoint

Previously, when generating Asciidoctor snipppets, based on this template, the path parameter was interpolated.
This was considered by Asciidoctor as an attributes which are typically surrounded by { and }. 

This commit surrounds the path with + characters which disables all interpolation.

Closes #326

* Review unit test after having surrounded the content of 'default-auto-method-path.snippet' with a '+' to avoid interpolating path variables

Closes #326
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant