Skip to content

CastAndValidate Plug doesn't work with readOnly fields #662

@skrech

Description

@skrech

Hello,

Wanted to report that as of version 3.21.2 the library is not working correctly with readOnly fields marked as required when using the automatic validation of requests from CastAndValidate Plug. It returns 422 error on requests missing the readOnly field, while it should allow them and only require this field when returning responses.

By looking at the code, I think that it's safe to assume that all the functions in the operation2.ex file should operate as :write scope, since they handle requests only.

This issue effectively re-opens #499.

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