Граф коммитов

189 Коммитов

Автор SHA1 Сообщение Дата
Ray Chen 6016762e88
Keep origin customized validator (#97)
* Don't reset customized validator.

Added unit test.
2020-03-27 22:24:55 +08:00
Ray Chen 5d3b0e2b62
Added global params validation. (#94)
For global paramemter the schema isn't combined by default when it has $schema defined.
2020-03-27 16:44:15 +08:00
Renhe Li 0f8aaf148d
support x-ms-mutability check for read in request (#93)
* Update the check for x-ms-mutability

* support x-ms-mutability check for read in request

* Update config for mocha

* Only handle x-ms-mutability[read] when readonly is not set

* Fix logic error

* update package lock file

* updated to use !==

Co-authored-by: FAREAST\renhel <renhel@microsoft.com>
2020-03-24 14:54:37 +08:00
JianyeXi d26d625c3c
Support dash(-) in path parameter name (#92)
* Support dash(-) in path parameter name

* format code

* fix package version

* update annotation
2020-03-24 10:11:19 +08:00
Renhe Li 5716c5db0b
Add the swagger spec path for all operations in the cache. (#89)
* Add the swagger spec path for all operations in the cache.

* Update the package version
2019-12-26 17:46:59 +08:00
Renhe Li f7960de58d
Update to use the official build of z-schema (#88) 2019-12-23 15:38:25 +08:00
nickzhums ece6f1bc98
Update x-ms-secret validation logic for live validation (#86)
* Update live validation logic for "x-ms-secret", specifically, check if x-ms-secret is "true" in the response. If so, throw an error
2019-11-22 16:22:31 +08:00
nickzhums b3798c1795
Use a faster deep clone library and update gulp to version 4 (#85)
During performance profiling of validation service v1 and v2, it was observed that lodash's deep clone takes a lot of time and CPU during initialization and API load testing.
It turns out that we can find a better deep clone library according to this benchmark:
https://github.com/ahmadnassri/benchmark-node-clone

After experimental testing, I've observed that latency has significantly reduced if we replace lodash's deep clone with clone-deep library (https://www.npmjs.com/package/clone-deep)

Therefore I made a few code changes and created this pull request to improve perf.
2019-11-19 14:58:22 +08:00
nickzhums 77ab4bcbe5
[S1007882] Support x-ms-mutability in response validation (#83)
Adjust logic in Z-schema custom validator to check if a write-only property (x-ms-mutability) is in the response. If so, report a WRITE_ONLY_PROPERTY_NOT_ALLOWED_IN_RESPONSE error. 

Added unit tests for x-ms-secret and x-ms-mutability
2019-10-31 17:05:06 +08:00
Renhe Li 906679ca6b
Add the support for x-ms-secret property (#82)
* Add custom validator to support additional validation work

* Implement writeOnly property

* Update the code to switch back to use 'x-ms-secret'

* Update to use @ts-common/z-schema
2019-10-12 13:37:02 +08:00
Ray Chen 4fb8e6f1df
Add path info to error message for parameters validation in examples. (#81)
* Add path info in error for parameters in examples.

Set path info in error message in case of it's null in internal error
messages.

* Add change log and bump package version.

* Fix tslint error.
2019-09-04 14:01:19 +08:00
Ray Chen 2eafebcf13
Skip to load parameter value when it's not provided. (#80)
* Skip to load parameter value when it's not provided.

* Return the value whatever it is undefined or null.

* Bump the package version.
2019-07-02 11:07:15 +08:00
Amar Zavery c8af63f200
Ensure propertyName is populated correctly in the error message for readonly property (#79) 2019-06-26 11:44:26 -07:00
Eric Williams 0223ed9ceb
Fix to properly return schemaPath in errors (#78) 2019-06-12 12:27:47 -07:00
Eric Williams d1bf668e95
Returning schema paths for missing required property (#77) 2019-06-10 13:01:20 -07:00
Amar Zavery 2e5991716d
Add support for validating readonly properties in the request payload (#74)
* check for type of the payload and presence of the discriminator in the payload while validating the discriminator

* Add support for validating readOnly properties in the request payload

* address review feedback

* fixed lint issue.
2019-05-29 15:03:58 -07:00
Vlad Barosan bed0b058a0
Update package version (#73) 2019-05-08 14:21:25 -07:00
Vlad Barosan 2743fdbd9a
Dont validate discriminator value when in the case of lenient discriminator (#72) 2019-05-08 10:13:30 -07:00
Vlad Barosan 377b3ea598
Do request body param validation when its an object (#71)
* Do request body param validation when its an object

* Improve code for missing required parameter
2019-04-10 17:11:29 -07:00
Vlad Barosan 1a2f694491
Skip validations (#70)
* Skip validation for response

* update z-schema to support skipping validations

* Validate parameters

* fix lint

* Skip invalid content type also
2019-04-05 14:14:20 -07:00
Vlad Barosan 9cedce73b8
Support polymorphic anyof (#69) 2019-04-01 16:47:18 -07:00
Sergey Shandar 20785fe256
`default` response is only applied for error status codes. (#64)
* `default` response is only applied for error status codes.

* 1.4.00
2018-12-06 17:01:33 -08:00
Sergey Shandar 0d632e770b
Move back to z-schema. (#62)
* back to Z-Schema

* ignore package-lock.json

* ignore .tgz files
2018-11-26 10:43:42 -08:00
Sergey Shandar 2768b08da5
Remove rewire. (#61)
* Remove rewire.

* switch to ts-common/s-zchema for now.

* z-schema => @ts-common/z-schema
2018-11-21 17:51:13 -08:00
Sergey Shandar 9dcf558333
fix json schema faker (#49)
* fix json-schema-faker

* 1.0.15
2018-10-02 11:07:03 -07:00
Sergey Shandar 6adde9c6a0
Switch back to z-schema (#47) 2018-09-24 10:22:31 -07:00
Veronica Giaudrone 0afda4f64e adding symbol info to semantic errors (#46)
* adding symbol info to semantic errors

* updating package version

* fixing quotes in require

* Update validators.js
2018-09-19 17:13:17 -07:00
Sergey Shandar 8ead61390a @ts-common/z-schema (#45)
* description in ResponseObject

* interesting

* package.json update

* update

* update

* update to `sergey/crlf`

* change branch

* Switch to @ts-common/z-schema
2018-09-11 12:43:46 -07:00
Vlad Barosan 6a73df4988
Add title field to schema type (#36)
* Add pretteir config and format

* Add optional name field to SchemObject

* Increment version

* Install from fork until upstream is released
2018-08-08 14:07:56 -07:00
Vlad Barosan 166bd2fc25 Add check for required property on x-ms-mutability type check 2018-05-30 02:57:49 -07:00
Vlad Barosan f9ff19b99b
Respect modelasstring true (#33) 2018-05-29 19:30:28 -07:00
Vlad Barosan 88f8f2cc88
Add custom type validator to support x-ms-mutability (#32) 2018-05-18 14:51:17 -07:00
Sarangan Rajamanickam c450cd6b77 Fix urlObject hostname to protocol 2018-05-14 14:28:12 -07:00
Vlad Barosan 361d0e8f5b
Add support for x-ms-mutability (#30) 2018-05-14 10:52:08 -07:00
Vlad Barosan 32784bab1c
Ensure string on toUpperCase call (#29) 2018-04-23 19:00:15 -07:00
mcardosos ca7e588001 Typo 2018-04-23 18:12:23 -07:00
mcardosos 80709ac468 [WIP] Fix CI 2018-04-23 18:10:22 -07:00
mcardosos 8ce102730d Semicolons 2018-04-23 17:55:55 -07:00
mcardosos 237bc2756e Fix CI 2018-04-23 17:53:26 -07:00
mcardosos 51f59feade Whitespace 2018-04-23 17:42:56 -07:00
mcardosos 5b558e5b86 Add path fixes 2018-04-23 17:17:39 -07:00
Vlad Barosan 02ede38a83
Differentiate between wrong enum value and wrong enum casing (#26)
* Differentiate between wrong enum value and wrong enum casing

* Fix CI issues
2018-04-19 19:24:01 -07:00
Vlad Barosan 1e7b7a404c Validate default responses 2018-03-14 18:16:23 -07:00
Vlad Barosan 21d2160311
Support OneOf for parameter validation (#24)
* Support OneOf for parameter validation

* disable browserify build without source maps as it fails
2018-03-01 09:01:48 -08:00
Amar Zavery a66e2f23fd
Merge pull request #22 from amarzavery/integration
Integrating changes from upstream master on 1/31/2018 @2:43 PM PST
2018-01-31 18:01:59 -08:00
Amar Zavery 347108298f satisfy linter 2018-01-31 17:31:15 -08:00
Vlad Barosan 5762a7c339
If there is no content-type set do not validate it (#21)
If there is no content-type set do not validate it as more often than not, it is not set and that does not mean that it should be 'application/octet-stream' as the RFC  www.w3.org/Protocols/rfc2616/rfc2616-sec7.html#sec7.2.1  suggests.
2018-01-31 14:59:26 -08:00
Amar Zavery 919f65f953 integrated upstream master on 1/31/2018 @2.:43 PM PST 2018-01-31 14:43:48 -08:00
Vlad Barosan e61f3efbd3 Add parameter to allow case insensitive matches 2018-01-30 19:11:26 -08:00
mcardosos 9305193853 Added query fix 2018-01-26 16:32:29 -08:00