You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 17, 2024. It is now read-only.
Expected behavior /resource should accept a value such as: {"eventType":"foo", "bar":"val"}
and reject a values such as: {"eventType":"not-foo", "not-bar":"val"} {"not":"acceptable"} {}
Is that correct?
I'm trying to understand exactly what can be expected of a data type validation library. I opened an issue with raml-java-parser and would like to find out if maybe I misunderstood what should be valid and invalid.
Thanks!
The text was updated successfully, but these errors were encountered:
Correct. To be clear, the reason those values would be rejected in that case is because both eventType and bar are required properties, for example {"eventType":"not-foo", "bar":"val", "not-bar":"val"} would be valid. In order to disallow any other properties, you would have to set additionalProperties to false on your fooEvent type.
Thanks @jstoiko :) It's been a long while since I opened this, but I think you confirmed a bug since {} is incorrectly accepted while it doesn't have the required eventType field.
Furthermore why would "not-foo" be accepted if there's no discriminator that matches that value?
To be clear that was the behavior when I opened this ticket about a year ago now. It may no longer be the case.
@jstoiko sorry to summon you back to this, but I'm reconsidering using RAML vs OpenAPI for some use cases (because I prefer RAML's data type system) but this specific question I'm still not clear on.
Why should "not-foo" be accepted if there's no discriminator that matches that value?
Can you attempt to parse and validate this using the latest version of AMF[1]? This is our reference parser now, the one you used back when you filed this issue has been deprecated.
Consider the following RAML
Expected behavior
/resource
should accept a value such as:{"eventType":"foo", "bar":"val"}
and reject a values such as:
{"eventType":"not-foo", "not-bar":"val"}
{"not":"acceptable"}
{}
Is that correct?
I'm trying to understand exactly what can be expected of a data type validation library. I opened an issue with raml-java-parser and would like to find out if maybe I misunderstood what should be valid and invalid.
Thanks!
The text was updated successfully, but these errors were encountered: