Closed sjimenez12 closed 8 years ago
Thank you for trying out a snapshot before opening an issue and for including lots of details.
As I said before, It worked beautifully on restdocs 1.1.0
As far as I can tell, that's not quite the case. In 1.1.0.RELEASE it actually gets the type of the field wrong (Object instead of Array). The difference is that 1.1.0 lets you override the incorrect type with your descriptor:
fieldWithPath("[]").type(JsonFieldType.ARRAY).description("This and That")
The thing that's changed is that 1.1.1 now throws an exception if you explicitly specify the type and it doesn't match what's actually there. That was changed in #276. The problem is that REST Docs is getting the type wrong for what's actually there.
@sjimenez12 This should now be fixed in the latest 1.1.2 snapshot
First of all, thanks for such a blazing fast answer...and fix, it is completely and utterly appreciated!
As I said before, It worked beautifully on restdocs 1.1.0
Call me a strongly typed man XD, but I always declare the type explicitly, so I meant it worked perfectly for me, but I see the problem now ;)
Everything works as expected now, types are correctly documented, both when inferred and when explicitly declared
Again, thank you for your time and for this awesome project, keep up the good work!
I'm having an issue that started since we upgraded restdocs from 1.1.0.RELEASE to 1.1.1.RELEASE and are still having on 1.1.2 SNAPSHOT.
Basically I have a JSON response like this one:
and when I try to document it using the responsefields like so:
I get the following exception
and, as you may imagine, when I let restdocs infer the type, It'll show Object instead of Array on the snippet. Something like this:
As I said before, It worked beautifully on restdocs 1.1.0, but it seems like it broke on 1.1.1. Maybe something changed that I'm not aware of? I've read the entire restdocs document for 1.1.1 and can't seem to find a solution for this.
I really appreciate any help you can provide.