Add support for environment variable validations#546
Merged
Conversation
Member
Author
|
@EmilyGraceSeville7cf - would you mind double checking my schema changes? |
EmilyGraceSeville7cf
previously approved these changes
Aug 14, 2024
| "validate": { | ||
| "title": "validate", | ||
| "description": "A validation function for the current environment variable\nhttps://bashly.dannyb.co/configuration/environment-variable/#validate", | ||
| "type": "string", |
Collaborator
There was a problem hiding this comment.
Suggested change
| "type": "string", | |
| "type": "string", | |
| "minLength": 1, | |
| "pattern": "^\\s+|\\s+$" |
I suggest adding more validations. I am not sure whether spacing matters, but I would prefer to have spacing checks done.
Member
Author
There was a problem hiding this comment.
Thank you. I applied the correction in the strings.json. As for the bashly.json, I am leaving it as is. Rationale:
- the bashly.json is generated from support/schema/bashly.yml
- the new
validateinenvironment_variablesis a copy-paste from the same function inargsandflags - I prefer these schemas to be a guide rather than being a complete lockdown on the exact requirements. Easier to maintain.
If you feel strongly otherwise, I might accept a separate PR with changes to bashly.yml rather than the JSON artifact.
Co-authored-by: Maisa Unbelievable <EmilyGraceSeville7cfg@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds support for using
validate(custom validations) in environment variables.Discovered in #545
Todo
bashly docscommandSample bashly.yml