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

57 Коммитов

Автор SHA1 Сообщение Дата
Zhenhua Hu 9a2fcc1bf5
Add Passed opeartions to the report (#1044)
* add pass operations to reports

* update package.json, package-lock.json and ChangeLog.md
2024-09-12 17:54:58 -07:00
Scott Beddall 186bb06af3
Port `arm`-specific changes into `develop` (#1025)
* bring all the accumulated changes from enable-armid-only branch
* update package version and npm update
* populate payload file
2024-02-20 13:57:17 -08:00
Scott Beddall ceb45d81e7
Resolve Regressions on on behavior of `anyOf` due to updates on `refWithReadOnly` (#1019)
* rename xMsReadOnlyRef to xmsReadonlyRef, resolving the 9 or so regressions caused by #996 and #1004

---------

Co-authored-by: semick-dev <sbeddall@gmail.com>
2023-11-15 11:03:56 -08:00
Scott Beddall 795eda540a
Resolve Erroneous `additionalProperty` error on `refWithReadOnly` (#1004)
* This PR adds to the 'selective ignore' list that is maintained to bypass certain errors that we want to ignore. here's the thing. I really think that the true solution is to fix this in the schema schemaValidator, as it's error on the property we're adding to the schema. Is there such a thing as properties on the schema that are present, but totally ignored for the purposes of validation? Need to investigate. in the meantime, this is what it would look like to just ignore this specific error

* move the test with the others

* apply prettier fixes

* add the necessary package and changelog updates to reflect the PR

---------

Co-authored-by: Scott Beddall (from Dev Box) <scbedd@microsoft.com>
2023-09-29 13:05:10 -07:00
Ke Yu fed7c550d9
[Test] Support readOnly on required properties (#996)
* Add refWithReadOnly
* Update isRefLike() to populate refWithReadOnly
* Add additional test file from mike kistler that should simulate the problem this branch is addressing
* Update test/modelValidation/swaggers/specification/readonlyNotRequired/openapi.json

Co-authored-by: Ke Yu <v-ky@microsoft.com>
Co-authored-by: Scott Beddall (from Dev Box) <scbedd@microsoft.com>
Co-authored-by: Scott Beddall <45376673+scbedd@users.noreply.github.com>
Co-authored-by: Mike Kistler <mikekistler@microsoft.com>
2023-09-22 12:21:14 -07:00
Eddy Ashton 340525eac6
Remove incorrect ASCII conversion (#979)
* Remove incorrect ASCII conversion
* Fix + extend byte format unit tests
* Update snapshots
* Apply snapshot-patch

Co-authored-by: Scott Beddall <45376673+scbedd@users.noreply.github.com>
2023-06-13 10:25:12 -07:00
Lei Ni 476efaa6e9
Fix empty html report bug (#946)
* rename method

* rename payload file

* fix parseValidationRequest

* add TrafficValidatorTests

* test case

* test case

* revert

* fix test case

* fix empty report

* fix test case

* rename folder

* resolve comments
2023-01-19 17:47:39 +08:00
Tianxiang Chen 5ad77f1e53
add json report in validate-traffic (#941)
* add json report in validate-traffic

* update changelog

Co-authored-by: Tianxiang Chen <tianxchen@microsoft.com>
2023-01-11 16:15:57 +08:00
Ray Chen e96760fd6a
Ignore unknown formats in AJV (#910)
* Ignore unknown formats in AJV

* Added testing spec

* Updated test
2022-11-23 17:27:40 +08:00
Ke Yu 0bc37900d2
Fix bug during reporting real exampleJsonPath (#902)
* Fix bug during reporting real exampleJsonPath

* update if condition

* prettier code

Co-authored-by: Ray Chen <raychen@microsoft.com>
2022-11-11 14:29:41 +08:00
Ke Yu e839be11c6
Add LRO header validation for data-planes swagger (#897)
* Add LRO header validation for data-planes swagger

* add azure-AsyncOperation

* Combine if condition

Co-authored-by: Ray Chen <raychen@microsoft.com>
2022-11-10 15:08:25 +08:00
Ke Yu a87a57277a
Retire some features (#860)
* retire validateExamplesInCompositeSpec in validate-example

* retire SpecValidator in validate-spec

* retire autorestPlugin

* retire dependencies

* retire vscode launch config

* revert simple semantic validation

* npm install

* clear unused dependencies

* update version

* update version to v3.2.0

Co-authored-by: Ray Chen <raychen@microsoft.com>
2022-10-11 16:26:32 +08:00
Matthew Christopher ccdcdfcf3c
ARM ID validation (#851)
* ARM ID validation

* Unit tests

* Restrict arm-id validation to examples and arm tra

* Refactor missing_resource_id rule

Ignore error when response body is empty in example validation;
Add isArmCall flag in semantic validation.

* Updated snapshot of example generation test

Test failed because the location is set as required property in resource model so response body only has location property and doesn't have id property.

* Updated snapshot for example validation test

* Delete examplegen snapshot

* re-add example gen snapshot

* add swagger changes

* add example files used by test

* added examples used by test

* Added all exmaples generated by auto gen

* update index value in model validation

Co-authored-by: raychen <raychen@microsoft.com>
2022-09-21 09:29:24 +08:00
Ke Yu 95f76f2c76
Support api-version validation (#854)
* support api-version validation

* fix modelValidatorTest

* fix example api-version

* update snapshot

* fix build error

* use continue instead of break

* update snapshot

* fill exampleJsonPath and examplePosition

* update snapshot

Co-authored-by: Ray Chen <raychen@microsoft.com>
2022-09-20 17:44:59 +08:00
Tianen 9875310b7e
Add markdown to swagger report (#853)
* add part of task

* add some changes about render full page render

* change position between test-failed and not-tested

* fix comment and change template that can support general normal case

* upper case api

Co-authored-by: v-tianxi@microsoft.com <v-tian@microsoft.com>
Co-authored-by: Ray Chen <raychen@microsoft.com>
2022-08-22 17:34:51 +08:00
Ke Yu 56ca2025c1
Fix bug when operation has no own parameters (#855)
* Fix bug when operation has no own parameters

* Use mergedParameters instead
2022-08-22 14:15:01 +08:00
Tianen b9c4927a23
[data-plane report] 3th update (#820)
* add utils function

* fix lint

* fix logic

* Update liveValidatorLoader.ts

* change  baselayout template

* update format code

* add resultForRendering big loop

* fix runtimeException bug

* update oav version

* add changelog

Co-authored-by: v-tianxi@microsoft.com <v-tian@microsoft.com>
Co-authored-by: Ray Chen <raychen@microsoft.com>
2022-08-04 17:14:32 +08:00
Ke Yu bf07412d3c
Support data validation and generation in byte format (#834)
* Enable byte format validation and generation

* update snapshot

* update liveValidatorTest snapshot

* update validateExamplesRegression snapshot

* update validation about base64 format

* update snapshot

* Cancel config setting about atob()

Co-authored-by: Ray Chen <raychen@microsoft.com>
2022-07-20 16:59:18 +08:00
Lei Ni 0e0d49c5b6
Generate example (#833)
* generateExample

* fix

* use translator

* scenario

* rename

* run

* test

* _swaggerFilePaths

* generateExample

* fix bug

* changelog

* 3.0.3

* fix bug
2022-07-06 12:02:03 +08:00
xiaoxu qi a4f99bf82e
Add activity id (#824)
* init

* version update

* version update

* update changelog

Co-authored-by: Ray Chen <raychen@microsoft.com>
2022-07-01 16:02:28 +08:00
Ke Yu 501faac110
Fix issues about: multipart/form-data, duration, exampleJsonPath, LRO validation and generate (#812)
* fix bug about multipart/form-data

* support duration format when generating examples

* bump oav version

* multipart form data should only have one file type parameter is required

* Report real exampleJsonPath when additional parameter includes '.'

* update logic about multipart/form-data

* still validate LRO operation when response doesn't have schema

* update exampleGeneratorTests snapshot

* update regression tests snapshot

* change the domain of LRO header

* update snapshot name

* skip error MULTIPLE_BODY_PARAMETERS when consumes includes multipart/form-data

* update test example fileName

Co-authored-by: Ray Chen <raychen@microsoft.com>
2022-06-24 17:15:32 +08:00
tianxchen-ms 78749305ba
Apiscenario (#747)
* change types

* commit

* fix loader

* fix variableEnv

* apiVersion

* add arm deployment script arguments

* fix

* fix compile error

* add setBatchEnv

* fix error

* fix error

* generate api scenario from swagger

* success run basic generated api scenario

* fix bugs

* fix deps

* request and response validate (#760)

* request and response validate

* fix markdown format and remove code

* remove unused code

Co-authored-by: Tianxiang Chen <tianxchen@microsoft.com>

* use pre-request script for auth

* set environment variables

* use location variable

* default step name

* fix

* use mocker to generate api scenario

* fix step name

* fix bug

* Fit example based scenario to new syntax (#763)

* Fit example based scenario to new syntax

* update snapshot

Co-authored-by: Tianxiang Chen <tianxchen@microsoft.com>

* add readme params

* [ApiScenario] support readme (#768)

* support readme

* add generate log

* use 3.0 autorest

* update schema

Co-authored-by: Tianxiang Chen <tianxchen@microsoft.com>

* fix schemaType

* fix requestUpdate and exampleResponseDiff (#775)

* fix requestUpdate and exampleResponseDiff

* fix response diff

* fix example diff

Co-authored-by: Tianxiang Chen <tianxchen@microsoft.com>

* 2.12.0-beta.0

* fix copyfiles

* 2.12.0-beta.1

* fix package.json

* 2.12.0-beta.2

* fix autorest version

* 2.12.0-beta.3

* remove autorest (#780)

Co-authored-by: Tianxiang Chen <tianxchen@microsoft.com>

* 2.12.0-beta.4

* armtemplate variable convention (#781)

Co-authored-by: Tianxiang Chen <tianxchen@microsoft.com>

* 3.0.0-beta.0

* test proxy recording loader

* util

* regex

* _testLoad

* Support remote uri (#784)

* remote cdn scenario

* fix local

* 3.0.0-beta.1

* fix analyze-report

* fix bug

* fix bug

* response assertion

* load readmeTag

* load readme tag

* load cross-rp swagger

* use cross-RP operation

* 3.0.0-beta.2

* test proxy recording

* fix example based template generate (#795)

* fix example based template generate

* fix commit

Co-authored-by: Tianxiang Chen <tianxchen@microsoft.com>

* start/stop testProxy

* polling through test proxy

* 3.0.0-beta.3

* add test for apiScenarioLoader (coverage: 79%) (#758)

* add test for apiScenarioLoader (coverage: 56%)

* add test for apiScenarioLoader (coverage: 79%)

* Apiscenario test (#800)

* remove log

* refactor pathEnv

* rename requestParameters & responseExpected

* add ApiScenarioLoader test

* test load from uri

* test load Spring.yaml

* skip test from uri

* test load appplatform basic.yaml

* load compute scenario

* remove compute/network/appplatform test

* postmanCollectionGenerator test (#801)

* fix eslint

* Apiscenario test (#803)

* ouput uncovered operations in verbose

* testProxy test case

* refactor

* update snaptshot

* tiny change

* use clientRequest

* fix loader test

* Apiscenario test (#806)

* add more scenario and generate base snapshot

* fix arm url

* remove uploadBlob option

* updateSnapshot

* fix bug

* prefix x_

* improve pseudo random

* fix variable scope

* Refactor runner client (#807)

* refactor postmanCollectionRunnerClient

* fix bug & update snapshot

* Remove shareScope (#808)

* fix bug

* remove shareScope

* support variable prefix (#809)

* Revert "remove shareScope"

This reverts commit 1ad06dd59a.

* fix variable scopes

* skipCleanUp if scopes are shared

* 3.0.0-beta.4

* skip test generate example

* remove obsolete snapshot

* fix comments

* fix fileLoader

* revert exampleGenerator specs

* add comment

* 3.0.0

* fix bug of fileLoader preloadCache

* fix fileRoot in run-api-scenario

* fix package-lock not in sync & fix eslint

* fix npm scripts & update CHANGELOG

Co-authored-by: Lei Ni <leni@microsoft.com>
Co-authored-by: Tianxiang Chen <tianxchen@microsoft.com>
Co-authored-by: Lei Ni <7233663+leni-msft@users.noreply.github.com>
Co-authored-by: Ke Yu <33389195+keryul@users.noreply.github.com>
2022-06-10 15:01:39 +08:00
Ray Chen 967a29d767
Support arm-id format (#802)
* Support arm-id format

* Added test

* Remove .only from test
2022-05-27 17:51:02 +08:00
Tianen 4abf2dfe26
Generate swagger report 2 (#797)
* first chagne

* finish

* revert launch.json

* change testFailed table width

* fix error and add args exception

* add js to hidden run time exception

* change login to render runtime exception

* fix comment to resolve cmd alias

Co-authored-by: Ray Chen <raychen@microsoft.com>
2022-05-23 17:26:14 +08:00
Ke Yu dff4f111c4
Get real schema and data while error's schema has allOf property (#798) 2022-05-16 17:31:46 +08:00
Ke Yu 3eec33d4ac
fix bug about query parameter validation (#767)
* Ignore INVALID_TYPE validation in case of query parameter in string format

* update revalidate logic

* align change log version

* put all the revalidate logic to function ReValidateIfNeed()

* set timeout to single test

* update revalidate logic

* update revalidate logic and test files

* clean old codes
2022-04-18 17:19:14 +08:00
Ray Chen 376b27a93b
Support traffic validation report generation (#769)
* Add report for traffic validation

* Update swagger accuracy report

* Add rendering data in report

* Add link and friendly name of error

* Generate Swagger Accuracy Report (#770)

* change baselayout template

* Fixed snapshot test failure

Co-authored-by: Tianen <347142915@qq.com>
2022-04-07 15:42:08 +08:00
Ke Yu d022e558a1
Clarify the error message of NOT_PASSED (#762)
* Clarify the error message of NOT_PASSED

* add change log

* add assert on the error location
2022-03-10 17:37:07 +08:00
xiaoxu qi 384248d42c
Xiaoxu/coverage: add coverage for each swagger file for trafficValidator (#757)
* init

* update operationCoverageResult,operationUndefinedResult, errorMessage and if-else-block

* modify error message
2022-03-02 11:29:44 +08:00
KeYu(AnkhSpirit) f202b99c57
fix bug about date-time validation (#752)
* fix bug about date-time validation

* test if the bug is fixed

* add test property and bump version

* update test property

Co-authored-by: Ray Chen <raychen@microsoft.com>
2022-02-16 14:02:36 +08:00
KeYu(AnkhSpirit) eb0d22d652
loosen date-time validation (#744)
* loosen date-time validation

* recode, fix test error, update snapshot

* update numberOfSpecs
2022-01-26 11:34:07 +08:00
KeYu(AnkhSpirit) 7ad54bc872
Fix false alarm for NOT_PASSED about multipleOf (#743)
* Fix false alarm for NOT_PASSED about multipleOf

* add test and update change log

* update test payload

* bump version to 2.11.5

* reduce the size of the payload file

* update validation logic
2022-01-24 15:53:52 +08:00
KeYu(AnkhSpirit) a92d1bec0f
Fix false alarm for WRITEONLY_PROPERTY_NOT_ALLOWED_IN_RESPONSE (#726)
* Fix false alarm for WRITEONLY_PROPERTY_NOT_ALLOWED_IN_RESPONSE

* update

* fix x-ms-secret check and add test case

* fix test error

* update rule for x-ms-mutability

* add test for more cases

* add test comments, update change log

* add validation on error code in tests

* update error code validation in tests
2022-01-10 15:57:05 +08:00
KeYu(AnkhSpirit) 7b99b9a672
Fix false alarm for OBJECT_MISSING_REQUIRED_PROPERTY (#725)
* Fix false alarm for OBJECT_MISSING_REQUIRED_PROPERTY

* update test file, update change log

* Update ChangeLog.md

* Update modelValidatorTests.ts

Co-authored-by: Ray Chen <raychen@microsoft.com>
2022-01-05 16:16:26 +08:00
KeYu(AnkhSpirit) 85293ed4a9
Fix LRO_RESPONSE_CODE rule (#724)
* update LRO_RESPONSE_CODE validation rule

* update snapshot

* update snapshot

* add test file for model validation

Co-authored-by: Ray Chen <raychen@microsoft.com>
2021-12-23 10:54:51 +08:00
tianxchen-ms 73dfa760e1
add new rules of discriminator (#707)
* add new rules INVALID_XMS_DISCRIMINATOR_VALUE and DISCRIMINATOR_PROPERTY_NOT_FOUND

* fix error meta param

* continue when invalid discriminator type

* fix comments

Co-authored-by: Tianxiang Chen <tianxchen@microsoft.com>
2021-11-22 14:54:51 +08:00
tianxchen-ms 0ac7ebb818
Fix false alarm for MISSING_PATH_PARAMETER_DEFINITION (#708)
* Fix false alarm for MISSING_PATH_PARAMETER_DEFINITION

* fix comments

Co-authored-by: Tianxiang Chen <tianxchen@microsoft.com>
2021-11-22 09:47:45 +08:00
Ray Chen f079ea65c5
Make response headers as optional (#705)
* Make response headers as optional

* adding test payloads

* Ignore LRO header check for livevalidator

* Support suppression on error code
2021-11-18 13:24:05 +08:00
Ray Chen 3329c1669d
Upgrade autorest schema (#701)
* Upgrade autorest schema

* Fix content-type and unknown format issue.

* fix snapshots
2021-11-09 08:43:42 +08:00
tianxchen-ms 58768ff1e1
check discriminator property type must be string (#698)
* check discriminator property type must be string

* add changelog and bump version

Co-authored-by: Tianxiang Chen <tianxchen@microsoft.com>
2021-11-04 16:50:39 +08:00
Ray Chen ad2c485d5a
support dataplane traffic validation (#696)
* support dataplane traffic validation

* add operationInfo and extends format

* bump version
2021-11-04 16:20:24 +08:00
Ray Chen 9024ac5b59
Fix error conversion issue in MV (#694)
* Fix error conversion issue in MV

* refactor output info in mv/sv commands

* fix snapshot of regression test
2021-10-26 15:45:55 +08:00
Ray Chen 15bc328187
User/raych1/new mv (#680)
* new version of model validation

* package info change

* Update some tests

* clean up some unused code

* support formData parameter

* fix lint issue

* update snapshot

* resolve external swagger error path

* fixed style issue

* fix error in semantic validator test while merging branch 'new-mv' (#691)

* fix snapshots

Co-authored-by: KeYu(AnkhSpirit) <33389195+KeYu-AnkhSpirit@users.noreply.github.com>
2021-10-20 13:42:57 +08:00
KeYu(AnkhSpirit) 36dfb6e868
update tests for semantic validator (#689)
* update tests for semantic validator

* fix suppress test

Co-authored-by: Ray Chen <raychen@microsoft.com>
2021-10-19 15:14:33 +08:00
Phoenix He 2e25ef5da2
Refactor Semantic Feature (#649)
* sync

* Add changelog

Co-authored-by: Phoenix He <tih@microsoft.com>
Co-authored-by: raychen <raychen@microsoft.com>
2021-08-12 17:36:27 +08:00
Ruoxuan Wang 9fdf0cd30f
Ruowan/dependency (#622)
* add error log when jsonPointer is invalid

* analyze dependency output resourceId definition json path

* remove unused code

* add test fixtures

* fix unittest

* small fix and optimise dependency structure

* add more field for dependencyResult

* export swaggerAnalyzer

* rename resourceType to fullResourceType

* update description

* bump version and update readme

* update package-lock.json

* update package-lock.json

* fix eslint

* fix prettier error

* test step any of to oneof

* bug fix: get armTemplate deployment parameters. add arm deployment
status check

* update changelog
2021-06-01 14:01:44 +08:00
Ray Chen a3176ba721
Update error message of some rules (#602) 2021-03-30 16:28:37 +08:00
Ruoxuan Wang ff64062a5b
Test scenario main (#599)
Support test scenario and test runner
2021-03-24 16:48:10 +08:00
Ray Chen ab8af58add
Update LRO rules for adding allowed response code (#598)
* Update LRO rules for adding allowed response code

* Fix style issue
2021-03-23 17:40:24 +08:00
Ray Chen 40b6b7fa84
User/raychen/lro (#588)
* Add LRO validation rule

* Added two rules for LRO validation in live validator.

* Exclude error response from LRO validation.
2021-03-16 16:55:13 +08:00