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

REQ: Help with special cases #183

@wolverine2710

Description

@wolverine2710

Hi Florian,

For starters, I apologize for abusing the 'issues' but I haven't been able to find another way to contact you, went to your website etc. Feel free to remove this issue.

I've RTFM-ed, read your slides, watched your video presentation and Googled but couldn't find what I'm looking for.

We have used Spring Rest Docs (SRD) for the last 6 months. It works very nice but its gets time consuming. Especially when writing unit tests outside the happy path. As in testing the fault situations where one supplies the REST with missing parameters etc. With SRD each and every field has to be accounted for. Hence a lot of work getting all the fieldWithPath descriptors correct.

We are trying to switch from SRD to SARD. Currently I'm creating a POC and try to convert existing unit tests to SARD. There are a couple of things which give me a slight headache. So I've a few questions:

  1. Is there a forum for SARD or a mailinglist or something like that. Haven't been able to find it.

  2. Is it possible to exclude variables from being shown in the generated REST documentation for example with a POST. We have Hibernate domain objects which have an id field. When creating the id is shown in the JSON response and needed later for example with a PUT. With a POST an id is not allowed. With SARD however the id is shown in all cases. Is it possible to suppress it when issuing a POST?

  3. We handle our JSON responses in a generic we and use a RESTResponse object for it. Code: return RestResponse.create(, HttpStatus.CREATED); RestResponse generates two JSON objects, meta{} and data{}. Meta contains the RestMetadata object. Its has a fixed number of fields AND SARD shows info for those field. The data object however changes all the time depending on what object we create and hence the fields in it. The only output we get from SARD is data (Path) Var (Type) false (optional) and a generic description. It is somehow possible to show the fields of . Thats essential for us.

  4. I've noticed that when using @notblank on the getter of a field that in the description javax.validation.constraints.NotBlank is shown and the optional field shows true. I had expected like with @NotNull that optional is false and that some intuitive message in the descrption would be shown. Is this a bug or this by desgin? Iirc I've seen for one or two other validators as well but can't recall them atm.

I hope you are able to help me out and/or point me to some forum where I asks questions and learn from other.

PS. SARD which like magic and its very very usefull.

With kind regards,
Jan

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions