Skip to content
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

Patterns for strings where feasible #60

Open
relsunkaev opened this issue Oct 20, 2021 · 1 comment
Open

Patterns for strings where feasible #60

relsunkaev opened this issue Oct 20, 2021 · 1 comment

Comments

@relsunkaev
Copy link

relsunkaev commented Oct 20, 2021

We use the OpenAPI schema to mock the Plaid API and generate responses for property-based testing. With some string fields (like account_id, item_id, and access_token) we had to add the patterns ourselves since any utf8 strings, including empty ones, are conformant to the definition and we didn't want to use up the testing time on unrealistic cases. Would it be possible to add patterns like [a-zA-Z0-9]{37}, access-(?:sandbox|development|production)-{insert uuid4 regex}, etc. for fields where possible? This would also help us know exactly what kind of output to expect from the API and when those outputs change format so that we can validate inputs more strictly and perform optimizations like adjusting string column lengths in our database.

@phoenixy1
Copy link
Contributor

I'll add this to the backlog. Note that we'd probably only want to do this for patterns that we are 100% sure will never change -- we've had issues where being overly prescriptive adds that enforcement to generated client libraries, which is not a thing we want to do because people are forced to upgrade their clibs to use the changed API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants