Commit Graph

42 Commits

Author SHA1 Message Date
Ahmed Yarub Hani Al Nuaimi
f5bb456ffa feat(example): set discriminated properties to mapped value (#8213) 2022-10-17 16:22:43 -07:00
Steven James
b825e44077 fix(fn): RandExp error should not cause UI to completely fail (#7940)
* regexp syntax varies across languages
2022-03-28 16:29:01 -07:00
dewijones92
3d79c24949 fix(examples): allow string created by regex pattern (#7829)
Co-authored-by: Tim Lai <timothy.lai@gmail.com>
2022-03-03 16:31:00 -08:00
Vladimir Gorej
87ccc247e0 refactor(memoize): get rid of memoizee prod dependency (#7799)
The memoizee dependency was replaced with specialization
of lodash.memoize.

Refs #7694
2022-01-26 17:39:47 +01:00
Vladimir Gorej
cf9a3657cc chore(deps): replace @kyleshockey/* deps with originals
@kyleshockey/object-assign-deep - replaced by lodash/merge. If behavior
not be compatible well use lodash/mergeWith.

@kyleshockey/xml - by installing stream library directly, we can use origin
xml library without the fork.

Refs #7341
2021-11-03 09:49:50 +01:00
Helen Kosova
f1aab53dd6 fix(sample-gen): generate the correct number of properties (#7432)
This commit fixes correct number of additionalProperties when minProperties is used.
2021-09-15 15:54:26 +03:00
Tim Lai
de3d063ca3 fix(sample-gen): parameter array missing items fallback (#7376)
* fixes #7375
2021-06-24 16:25:54 -07:00
Mahtis Michel
032bd71e0a feat(sample-gen): infer implicit type and validation constraint types (#7117)
* this closes some dead ends of sample generation where no sample can be generated
2021-03-30 14:28:51 -07:00
Tim Lai
4d264ae17f chore(lint): cumulative lint fixes prep for eslint@7 (#7078) 2021-03-16 10:11:35 -07:00
Mahtis Michel
3ead825287 feat: sample gen should incorporate schema validation constraint (#7043)
* feat(sample-gen): handle minProperties, maxProperties

* fix(sample-gen): lift required

* feat(sample-gen): handle minimum, maximum (+ exclusive)

* feat(sample-gen): handle minLength, maxLength
2021-03-10 13:19:45 -08:00
Mahtis Michel
902241cf7e fix(sample-gen): xml attr with media-type example value (#7045) 2021-03-10 12:44:54 -08:00
Mahtis Michel
f9e54a26bf fix(sample-gen): allOf, oneOf lifting should consider properties and items (#7041) 2021-03-10 11:18:54 -08:00
Mahtis Michel
7ead9baa80 * fix(sample-gen): enum without type should be handled by sample-gen (#6912) 2021-02-11 09:58:28 -08:00
Mahtis Michel
5b2ad68f50 fix(sample-gen): case yaml parsed example is number but string schema (#6872) 2021-01-28 09:04:15 -08:00
Mahtis Michel
a2f7917661 fix(sample-gen): should return json literal example (#6827)
* fix(sample-gen): should return json literal example

* test(sample-gen): should return json literal example
2021-01-14 10:59:35 -08:00
Mahtis Michel
59b42bb38f fix(sample-gen): should return xml literal example (#6822) 2021-01-12 19:01:44 -08:00
Mahtis Michel
35cb92502a fix(sample-gen): should render additionalProperties in example (#6821)
* fix(sample-gen): should render additionalProperties in example

* test(sample-gen): should return additional property from example
for object and array schemas
2021-01-12 17:55:23 -08:00
Mahtis Michel
0f541a1ab0 fix(sample-gen): first oneOf or anyOf should be combined with schema (#6775)
* fix(sample-gen): oneOf and anyOf should be merge into schema

when there was oneOf or anyOf defined it just used the first schema of it to generate the samples.
Now, the first oneOf or anyOf is combined with the schema to generate samples.

* test(sample-gen): oneOf and anyOf should be combined with schema
2021-01-07 11:26:34 -08:00
Tim Lai
d2ef8f31b9 fix(examples): properly update memoized value in non-schema case (#6641) 2020-11-19 13:55:32 -08:00
Tim Lai
24225e47bf fix(xml): example generation if an array has an example (#6634)
ref: #6627
2020-11-18 15:19:52 -08:00
Mahtis Michel
288c89bdbb fix(schema example): xml gen should follow json gen behavior (#6555)
* ref: #6470 
* fixes: #6540
* fixes: #4943 

* add example override option to json
* add example override option to xml
* added basic oneOf and anyOf support
* fix anyof|oneof
* only lift xml to items


Co-authored-by: Tim Lai <timothy.lai@gmail.com>
2020-11-03 10:58:59 -08:00
kyle
074eaa5d51 fix: prevent object inheritance mutations in recursive sampleXmlFromSchema calls (via #5034)
* fix: prevent object inheritance mutations in recursive sampleXmlFromSchema calls

* fix unrelated test
2018-11-16 21:02:23 +01:00
Helen Kosova
89868a85bb feat: sample value generation for uuid, hostname, ipv4, & ipv6 formats (via #5033) 2018-11-16 13:22:42 +01:00
Jeremy Hayes
078bca3566 feat: sample value generation for date formats (via #5024) 2018-11-16 00:49:23 +01:00
kyle
b9300211bb housekeeping: xml -> @kyleshockey/xml (via #4985) 2018-11-01 14:33:05 -04:00
Tim Macfarlane
9a9cfdf101 improvement: omit deprecated fields in examples (via #4758) 2018-08-20 14:11:50 -07:00
kyle
478d93ae08 Example (#4730)
* add tests for example feature
* refactor ParameterRow value setter logic
* aside: fix property access in sampleFromSchema
* prioritize media type examples for OAS3 responses
* use `example` in schema level example
* refactor: move stringify to utils
* prioritize media type examples in OAS3 request bodies
* modify nightwatch config
* fix parameter/response regressions
* reorder and broaden default value sources
* update lockfile
2018-07-14 03:09:37 -04:00
kyle
9d02a7d8ad fix(sample-gen): respect null values in examples (via #4679)
* improvement: re-enable and improve Models jump-to-path

* fix(sample-gen): respect null values in examples
2018-06-27 19:40:00 -07:00
kyle
fd8274b353 Filter $$ref from examples (#4392)
* fix(dev-server): don't open localhost in a browser
* tests: refactor model-example enzyme tests to be more isolated
* tests: add failing sampleFromSchema tests for $$ref keys
* tests: add additional test for user-created $$ref values
* fix: create deeplyStripKey; use it to filter $$refs out of examples
* tests: add cases for deeplyStripKey
2018-03-30 18:02:32 -07:00
kyle
003a2e7584 fix: don't assign example if an example does not exist (#4365)
fixes #4319
2018-03-24 02:04:01 -07:00
kyle
b0be261ef8 fix: remove $$ref key from example if it exists (#4333)
* fix: remove $$ref key from example if it exists

* guard $$ref property access
2018-03-15 16:40:04 -07:00
Pavel Stefanov
b13b05e416 improve: support for oneOf and anyOf in array sample (#4136)
* Fixed oneOf and anyOf in array example

* Added tests for sampleFromSchema for array type

* Removed return example for array item
2018-03-02 16:42:51 -08:00
narutowyh
12a9fbc0ca fix: ignore prototype's keys in a handful of for...in loops 2018-01-05 21:57:17 -06:00
Kyle Shockey
b464d2c977 pass entire config to recursive sample calls 2017-08-10 18:39:43 -07:00
Kyle Shockey
9af5d2dc66 Add writeOnly support to sampleFromSchema; add tests for the same 2017-08-03 17:23:16 -07:00
Kyle Shockey
5e96821c05 Add writeOnly logic 2017-08-03 17:13:38 -07:00
shockey
8d4750d76c Merge branch 'master' into ft/3289-boolean-default-value 2017-06-26 18:11:35 -07:00
Owen Conti
8b073757fe #3289 - Update boolean sample function to accept schema object and return value based off of schema's default value (if exists) 2017-06-25 09:59:12 -06:00
Derek Wickern
34c57fb018 Disable sample response for file transfer 2017-06-20 10:18:42 -07:00
Furkan Ayhan
6965a496fb Show readOnly values in responses 2017-04-13 16:01:29 +03:00
Anna Bodnia
4ebe2273da fixes for XML render 2017-03-22 16:14:20 +02:00
Ron
f22a628934 in with the new 2017-03-17 21:17:53 -07:00