New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Management of Required and ReadOnly with Array does not work correctly #2336
Comments
Could also be an issue if Dog is a property of another object. Need to check this case as well. |
@chohmann tested with Dog as a property of another Object the bug looks not there ! see below spec
if i send wrong payload such as a dog like this "nane" : "typo"
|
Hi! I am working on this issue and I have a quick question. I have what I think is a working solution for non-tuple typed arrays (i.e., arrays where every elements conforms to a single schema, like:
However, as I continue trying to implement the fix for tuple-typing, it has proven to be much more difficult (i.e. multiple schema corresponding to individual array items, like:
@rattrayalex I can submit the solution for the non-tuple typed arrays in the next day or so -- would you like me to continue working on the tuple typed cases after this? Thanks! |
Sure, a follow-on PR with the other fixes sounds like something we'd be happy to sponsor! |
sounds good and fortunately I was actually able to do it for tuple typed arrays as well, which is all in the PR! |
Context
given an object with a readOnly required field, prism does not handle it properly as soon as the object is embbed into an array
prism mentionned that the readOnly paramater is mandatory even for POST operation
notice that this occurs only when object is in array, and works correctly otherwise (sample provided below)
This is the case for prism in proxy mode or in mock mode
Expected Behavior
no error should be raised
Possible Workaround/Solution
no real solution available looks a bug
Steps to Reproduce
given the API spec here containing 2 endpoints one with array one without
Dog is a simple object with id as readOnly and name as string
dogs is an array of Dog
doing
is OK
but doing the test with the array endpoints
fails with the following
Environment
tested on windows with prism 5.1.0
The text was updated successfully, but these errors were encountered: