This message was deleted.
# questions
s
This message was deleted.
p
It is not clear from the above information to figure out the cause. Can you try setting breakpoint to the NPE (NullPointerException) class and read the stacktrace to isolate the problem.
t
I have tried debugging the issue but it doesn't really make me any wiser... When I click on the lines from the stack trace I end up on line 1 in some decompiled class and, the output is full of
groovy.lang.MissingPropertyException: No such property: e for class: DUMMY
which probably originates from the debugger... I might have to do a clean Grails 6 project and then move my Spring Restdoc configuration over bit by bit...
m
This is slighty OT, but @Thomas Rasmussen do you mind sharing how you have integrated "spring rest docs" with Grails 4/5/6 ? I am in the process of upgrading a version 4 web app and need to document the rest API, have searched for information about that but I couldn't find anything relevant solution (at least recent) for Grails
t
I tried upgrading this Grails 3.x Spring Restdocs example: https://github.com/jlstrater/grails-spring-restdocs-example/ And I think this is the issue (junit 4
@Rule
): https://github.com/jlstrater/grails-spring-restdocs-example/blob/master/src/integration-test/groovy/com/example/ApiDocumentationSpec.groovy#L29
Copy code
java.lang.NullPointerException: Cannot invoke "org.springframework.restdocs.StandardRestDocumentationContext.getAndIncrementStepCount()" because "this.context" is null
But I haven't figured out how to set the context...
g
@Thomas Rasmussen @mvorg A while ago I got spring restdoc working on Grails5 here: https://github.com/groovyduke/rest-docs/tree/g5 However, after the upgrade I was left with an issue where I couldn't do navigation the same because I had it so I generated multiple pages and generated navigation on the left that allowed navigation to those multiple pages. With the newer version of the Ascidoc plugin, the method I was using for the navigation didn't work. Although despite that issue what I did in that project might help, because I got around the JUnit rule issue.
t
@Groovy Duke Your JUnit rule fix worked for me, I can now correctly generate documentation! 🥳 Thanks
👍 1
m
Thank you @Groovy Duke, that's much appreciated resource for getting started with spring rest docs: the issue you are referring to is that currently the documentation is a single page document with side-TOC (https://virtualdogbert.github.io/rest-docs/rest-docs.html) instead of a multi-page setup?
g
Yeah on the master branch I have a multi-page setup and I had a way to get the side TOC to work, but with the newer version of the ASCII doctor plugin it doesn't render the side TOC links like it use to. I never figured out how to get that to work and haven't gotten back to that project. If you set everything up for a single page it works fine, however if you have a big API having everything on a single page can slow things down as you add on to it
👍 1