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

308 Коммитов

Автор SHA1 Сообщение Дата
JianyeXi 33a8222912
Example generation improvement (#550)
* add example cache

* improve merge array cache algorithm

* fix comments

* fix snapshot

Co-authored-by: jianye xi <jianyxi@microsoft.com>
2021-01-07 10:52:02 +08:00
Phoenix He 5f01014b4b
Always transform response code (#549)
* Always transform response code

* Add test
2020-12-22 09:54:34 +08:00
Phoenix He 1a1cb1cbe7
Support loading swagger examples (#546) 2020-12-01 09:28:32 +08:00
Ray Chen d2486f4f53
Update README.md 2020-11-30 10:09:41 +08:00
raychen fcc6da5bf9 Ignore body schema validation when schema is not required and body value is empty. 2020-11-25 14:59:48 +08:00
raychen 0d8fc2952e Ignore required rule validation in response in case of x-ms-secret. 2020-11-25 10:30:34 +08:00
raychen 8815d179d1 Release 2.0.0 version 2020-11-24 11:07:36 +08:00
Ray Chen 814697931f
Fixed two bugs in error handling (#544)
* Fixed two bugs in error handling.

Output model detail in log when resolve it with failure,
report error when the example reference has issues.

* Add error code.

* Add test for missing example reference.
2020-10-16 17:07:31 +08:00
Ray Chen 424143000c
Ignore invalid yaml object when parse error. (#539)
* Ignore invalid yaml object when parse error.

* update package.lock
2020-09-16 15:18:52 +08:00
Wenhao Zhang ba6b5bef61
fix name to ONE_OF_MULTIPLE (#536)
Co-authored-by: t-zhangw <codespace@72c482c53b75>
2020-09-07 17:16:12 +08:00
Wenhao Zhang 6eafef4e1d
New function getErrorsFromSemanticValidationForUnifiedPipeline (#533)
* Revert "Update function getErrorsFromSemanticValidation to extract inner error correctly (#530)"

This reverts commit cd3896e62c.

* New function for unified pipeline to extract semantic validation inner error.

* export serializeErrorsForUnifiedPipeline

Co-authored-by: t-zhangw <codespace@72c482c53b75>
2020-09-07 13:59:10 +08:00
Wenhao Zhang cd3896e62c
Update function getErrorsFromSemanticValidation to extract inner error correctly (#530)
* Fix oav bug

* lint fix

* bump version and add changelog

Co-authored-by: t-zhangw <codespace@72c482c53b75>
2020-09-04 10:51:09 +08:00
Renhe Li f12bb2528c
Fix the additional path item problem for error path (#527)
* Fix the additional path item problem for error path

* Update snapshot file

* Support writeonly property

* Apply the change for write_only property

* Update the version of OAV

Co-authored-by: FAREAST\renhel <renhel@microsoft.com>
2020-08-18 16:28:07 +08:00
Ray Chen 46f761f01a
Fixed nullable value bug (#511)
* Fixed nullable value bug

Avoid adding nullable value for parameter when its' type isn't string.
2020-05-25 17:30:58 +08:00
Ray Chen 8de3343464
Output semantic exceptions in pipeline. (#510)
* Output semantic exceptions in pipeline.

* Change console output.
2020-05-19 16:40:08 +08:00
Renhe Li 7580d59a80
It looks the problem of microsoft.resources was already resolved. Add test case to verify the bahaviour (#509)
Co-authored-by: FAREAST\renhel <renhel@microsoft.com>
2020-05-15 17:01:22 +08:00
Ray Chen 11713918e3
Output the exception information when pretty switch is enabled (#504)
* Bug #1106292 output exception info

Output the exception information When pretty switch is enabled.
2020-04-20 14:43:30 +08:00
Renhe Li 78833af62c
Only log once for the message (#505)
Co-authored-by: FAREAST\renhel <renhel@microsoft.com>
2020-04-20 12:23:09 +08:00
JianyeXi 3ddb780aa9
fix model validation failure when path parameter value containing sep… (#502)
* fix model validation failure when path parameter value containing sepecial charaters

* handle useSchemePrefix property in x-ms-parameterized-host

* update

* handle default useSchemePrefix

* fix snapshot

Co-authored-by: Jianye Xi <jianyxi@microsoft.com>
2020-04-10 17:08:13 +08:00
Ray Chen 1deda4b25d
Enable request parameter suppression. (#493)
* Enable request parameter suppression.

Added suppression as member property in base class;
Request only includes parameter, enable parameter name match suppression.
2020-03-23 14:57:41 +08:00
JianyeXi 1c702e952a
Fix invalid internal reference can not report error (#489)
*  check if all internal reference defined
2020-03-19 20:56:08 +08:00
JianyeXi 0aeec688e1
fix issue caused by host path parameter value with url (#482)
* fix  issue caused by host path parameter value with url

* update test snapshot

* update comment

* update test snapshot

* bump up version

* fix typo

* Workaround azuredevops isssue.

There's an issue with YAML pipeline triggers which doesn't trigger
pipeline when it's not explicitly specified in yaml file.

* fix snapshot

Co-authored-by: Ray Chen <raychen@microsoft.com>
2020-03-16 10:46:08 +08:00
Ray Chen 8e702bfc23
Fixed typeerror when search in unknownapiversion. (#481)
* Fixed typeerror when search in unknownapiversion.

added check when search in unknownrp->unknownapiversion;
added unit test.

* Update changelog and bump package version.

* Fix snapshot test.
2020-03-10 17:16:22 +08:00
Ray Chen a1d3bf37a0
Upgraded package version. (#480)
Upgraded openapi-markdown pkg version.
2020-03-03 14:20:49 +08:00
Ray Chen 503e4fd92b
Upgrade virtual-fs pkg version. (#479)
* Upgrade virtual-fs pkg version.

* Upgrade json-parser package version.

* Tweak logging message.
2020-03-02 14:55:49 +08:00
Ray Chen 8de2d085eb
Fall back to child resouce match for liveValidator (#478)
* Fall back to child resouce match for liveValidator

Fall back to match operations in cache to child resouces if having both
of parent and child resouces in request url.

* Fixed the unit tests.
2020-02-14 15:35:46 +08:00
Renhe Li 2c3d07f881
The path matching for live validation should be case insensitive (#477)
* The path matching for live validation should be case insensitive

* update the change log
2020-02-13 10:32:30 +08:00
Ray Chen 48739264de
Base model discriminator value fix. (#476)
Previously for polymorphic case, the discriminator value was set to
model name in case of base model. It should also keep original enum
values which is used in model validation. So this fix is to keep
original enum values then add base model as first element in the enum
values list.
The reason to put base model name as first element is the first element
is used to match the discriminator value of polymorphic models and for
base model case the discriminator should be base model name.
Added a unit test for this change.
2020-02-06 17:38:25 +08:00
Renhe Li 178de9bfeb
Update the check for MultipleOperationsFound (#473)
* Update the check for MultipleOperationsFound

* Update the package version

* address comments in the review
2020-01-06 15:20:21 +08:00
nickzhums 7c40ac8572 Exclude certain swaggers during cache initialization in OAV (#467)
* Add default ignore patterns and update tests

* Test

* Update ignore paths code

* Fix conflict

* Lint tool fix

* Lint tool fix

* Update tests

* Lint fix
2019-12-16 17:23:31 +08:00
Ray Chen 09f76726d8
Task #1032251 live validator swaggerPathPattern (#466)
* Task #1032251 live validator swaggerPathPattern

Change the swaggerPathPattern to array type from string.
2019-12-05 17:43:14 +08:00
nickzhums d5deab2023 Resource provider and API-version should be case-insensitive for live validation (#461)
* Convert API version to be lowercase during validation and add uunit tests

* Bump oav and yasway version

* Fix tsc formatting issue

* Update outdated unit test

* Update test snapshot

* Update changelog

* Lowercase the query string as well
2019-11-21 15:26:44 +08:00
nickzhums e1e7f7000a
[S1007882] Check if x-ms-mutability property is write-only in the response validation (#459)
* Check if x-ms-mutability property is write-only in the response validation. If so, report an error.
2019-11-04 14:45:27 +08:00
Ray Chen e582db9b31
Extends logging and metrics. (#458)
* Extends logging and metrics.

Add corrleationId;
Log execution time for each operation;
Log splited request info for each call.

* Bump version and minor change on feedback.
2019-10-22 22:55:50 +08:00
Ray Chen 669febd7df
Improve logging for livevalidator (#457)
* Improve logging for livevalidator

Added an optional logging callback to consume by livevalidtor to dump
logs to external caller.
2019-10-14 13:28:14 +08:00
Renhe Li a4b3f87b39
Apply the latest version of yasway and add the error code of SECRET_PROPERTY (#456) 2019-10-12 16:41:58 +08:00
Renhe Li 26cb277199 add unresolvable_reference into error codes (#455)
* add unresolvable_reference into error codes

* Update the version and cleanup employee.json file
2019-09-30 10:47:47 +08:00
Ray Chen 3b8eacdc91
Add prefix to log entry to disaply in github. (#454)
* Add prefix to log entry to disaply in github.

* Wrap message as well.
2019-09-18 15:44:28 +08:00
Ray Chen 6bf90059b9
Fixed internal errors when load local reference file (#452)
* Fixed two internal errors: issue#449 and issue#444.

* Also throw error when load an empty reference file.

* Upgrade yasway version to take path fix.
2019-09-05 10:38:24 +08:00
Ray Chen 3e29e1344a
Report exmaple position for request errors (#445)
* Report exmaple position for request errors

Issues#423

* Prevent duplicate loading example file.

* Add some await keyword.

* Fixed unit test.
2019-09-04 13:48:49 +08:00
Renhe Li b25a7827cf
Update the load of suppression file for better error handling (#448)
* Update the load of suppression file for better error handling

* Update change log and change the package version
2019-08-12 16:55:14 +08:00
Amar Zavery 4123d46bee
fix validation for nullable array types and fix a discrepancy in specResolver (#440)
* fix validation for nullable array types and fix a discrepancy in specResolver

* update test snapshot

* apply patch
2019-07-30 15:17:13 -07:00
Ray Chen bcb532dd5c
Report error if 'discriminator' is not required (#439)
* Report error if 'discriminator' is not required

Issue #386 OAV report error if the property for 'discriminator' is not a
requried property.

* Update error object.

* Add an unittest.

* Add suppression process for discriminator.

* Fix review comment and bump up package version.
2019-07-17 09:54:55 +08:00
Sergey Shandar 24cd33cc15
@types/jsonpath and typescript 3.5 (#442)
* @types/jsonpath and typescript 3.5

* no more internal errors?

* minor
2019-07-15 11:01:48 -07:00
Renhe Li 8a7bace89e
Update pathInPayLoad for MISSING_REQUIRED_PROPERTIES and OBJECT_ADDITONAL_PROPERTIES (#438)
* Path in payload for MISSING_REQUIRED_PROPERTIES and for OBJECT_ADDITIONAL_PROPERTIES should point to the property.

* Update the handling for JsonPathInPayload

* Put the missing/additional property handling into setPathProperties

* revert the change in LiveValidator.ts

* Modify the snapshot of the test and change the version to 0.18.7

* update the minor version instead of patch version
2019-07-12 11:21:34 +08:00
Ray Chen 6b4c9a849e Added one more rule for response validation in model validation. (#436)
* Added one more rule for reponse validation.

Fail the validation when there's schema defined for response body in spec but the example
response doesn't provide the body in response.

* Fix the exmaples for unit tests.

* Added two more unit tests.

Coverage for the new added rules about body/schema validation in
response.

* Apply snapshot patch.

* Bump package version and update changeLog file.

* Apply snapshot patch.

* Update version number in changeLog.

* Apply snapshots patch again.

* Update per the review comment.

* Update test snapshot.
2019-07-08 16:02:37 -07:00
Eric Williams d54eaf3cfd
Adding support for JSON path & schema path in errors (#428)
* JSON path support
* Support for schemaPath in errors
2019-06-12 14:19:59 -07:00
Timothee Guerin b89ec0b0e6
Fix: Better error return when cannot find a reference (#427) 2019-05-30 14:37:51 -07:00
Amar Zavery 9b3f0009ec
update cache initialization to Promise.all and update yuml2svg package version and add test for readonly properties (#424)
* update cache initialization to Promise.all and update yuml2svg package version

* nit fix and test artifact update

* Adding tests for validating readOnly properties

* Fix type issue

* Fix type

* Add amar snapshot changes

* address code review feedback

* update changelog and bump min version of yasway to 1.7.3
2019-05-29 15:37:21 -07:00
Vlad Barosan 74a81b3b2c
Use node env for jest (#422)
* Use node env for jest

* Fix tslint
2019-04-25 12:19:46 -07:00