-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generated examples are not valid when using regular expression patterns #152
Comments
Added to RapiDoc just now: https://github.com/rapi-doc/RapiDoc/pull/947/files#diff-82d61daee06cfa4e64b7d6351db4581c12a0b04c8d7f6f5960f970b8d0835c95R268-R274 Should be doable in ReDoc too, just need to pass in the openapi-sampler/src/samplers/string.js Line 130 in d143da1
Will post PR shortly. |
This fixes Redocly#152 except in an edge case where both `pattern` and `maxLength` are used, and the sampler skips over the valid length range. It introduces a tiny dependency (<10 KB uncompressed) which doesn't really have any prominent competitors.
This fixes Redocly#152 except in an edge case where both `pattern` and `maxLength` are used, and the sampler skips over the valid length range. It introduces a tiny dependency (<10 KB uncompressed) which doesn't really have any prominent competitors.
This fixes Redocly#152 except in an edge case where both `pattern` and `maxLength` are used, and the sampler skips over the valid length range. It introduces a tiny dependency (<10 KB uncompressed) which doesn't really have any prominent competitors.
This fixes Redocly#152 except in an edge case where both `pattern` and `maxLength` are used, and the sampler skips over the valid length range. It introduces a tiny dependency (<10 KB uncompressed) which doesn't really have any prominent competitors.
This fixes Redocly#152 except in an edge case where both `pattern` and `maxLength` are used, and the sampler skips over the valid length range. It introduces a tiny dependency (<10 KB uncompressed) which doesn't really have any prominent competitors.
This fixes Redocly#152 except in an edge case where both `pattern` and `maxLength` are used, and the sampler skips over the valid length range. It introduces a tiny dependency (<10 KB uncompressed) which doesn't really have any prominent competitors.
This fixes Redocly#152 except in an edge case where both `pattern` and `maxLength` are used, and the sampler skips over the valid length range. It introduces a tiny dependency (<10 KB uncompressed) which doesn't really have any prominent competitors.
This fixes Redocly#152 except in an edge case where both `pattern` and `maxLength` are used, and the sampler skips over the valid length range. It introduces a tiny dependency (<10 KB uncompressed) which doesn't really have any prominent competitors.
This fixes Redocly#152 except in an edge case where both `pattern` and `maxLength` are used, and the sampler skips over the valid length range. It introduces a tiny dependency (<10 KB uncompressed) which doesn't really have any prominent competitors.
This fixes Redocly#152 except in an edge case where both `pattern` and `maxLength` are used, and the sampler skips over the valid length range. It introduces a tiny dependency (<10 KB uncompressed) which doesn't really have any prominent competitors.
This fixes Redocly#152 except in an edge case where both `pattern` and `maxLength` are used, and the sampler skips over the valid length range. It introduces a tiny dependency (<10 KB uncompressed) which doesn't really have any prominent competitors.
This fixes Redocly#152 except in an edge case where both `pattern` and `maxLength` are used, and the sampler skips over the valid length range. It introduces a tiny dependency (<10 KB uncompressed) which doesn't really have any prominent competitors.
This fixes Redocly#152 except in an edge case where both `pattern` and `maxLength` are used, and the sampler skips over the valid length range. It introduces a tiny dependency (<10 KB uncompressed) which doesn't really have any prominent competitors.
Fixes Redocly#152. Vendors a tiny dependency (total dependency tree <10 KB uncompressed). Other than removing unused code from the dependency, the only change made is to change the following line: https://github.com/fent/randexp.js/blob/2b35ea607883fa8cafa63bd3bdb5c12d695f873a/lib/randexp.js#L109 to a separately customizable callback.
Fixes Redocly#152. Vendors a tiny dependency (total dependency tree <10 KB uncompressed). Other than removing unused code from the dependency, the only change made is to change the following line: https://github.com/fent/randexp.js/blob/2b35ea607883fa8cafa63bd3bdb5c12d695f873a/lib/randexp.js#L109 to a separately customizable callback.
OK, just proposed a solution in #153. BTW if ignoring minLength / maxLength constraints is acceptable then there is a one-liner solution. |
Fixes Redocly#152. Vendors a tiny dependency (total dependency tree <10 KB uncompressed). Other than removing unused code from the dependency, the only change made is to change the following line: https://github.com/fent/randexp.js/blob/2b35ea607883fa8cafa63bd3bdb5c12d695f873a/lib/randexp.js#L109 to a separately customizable callback.
Generated examples are not valid when using regular expression patterns.
In this case, the example is simply "string" without honoring the regular expression.
Steps to replicate:
Observe the example rendered as
{"test": "string"}
that is not valid against the schema.Original issue: Redocly/redoc#2312
The text was updated successfully, but these errors were encountered: