mulesoft / osprey

Generate Node.JS API middleware from a RAML definition
Other
431 stars 66 forks source link

How to reject requests with extra body parameters? #195

Closed purefan closed 5 years ago

purefan commented 5 years ago

given a RAML file with a type and properties, osprey does not reject a request that includes more params than those defined, did I get this right or am I perhaps missing a variable or something?

jstoiko commented 5 years ago

Right, it ignores them. This is not Osprey-specific btw. In RAML — as in other schema languages such as JSON Schema and by default in some programming languages such as JavaScript — objects are mutable by default. Specifying additionalProperties: false on that object, reverses that behavior.