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

Is string values pattern matching in the scope of this project? #57

Open
samuelazran opened this issue Aug 7, 2024 · 0 comments
Open

Comments

@samuelazran
Copy link

I'm curious about the use case where you need to extract strings with predefined requirements that is easy to validate such as phone numbers or car license numbers in specific regions that follow a predefined pattern. Similar to HTML input pattern: https://www.w3schools.com/tags/att_input_pattern.asp

Example:

car = {
  "type": "object",
  "properties": {
    "car": {
      "type": "object",
      "properties": {
        "make": {"type": "string"},
        "model": {"type": "string"},
        "year": {"type": "number", *"range": [1900, 2028]*},
        "license_number": {"type": "string", *"pattern": "[0-9]{6,7}"*}
      }
   }
}
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

1 participant