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

feat: Extend allowed_values option of JSONSchema for Property(ArrayType) #1602

Conversation

TyShkan
Copy link

@TyShkan TyShkan commented Apr 11, 2023

Closes #1600 (what a number! 🎉)


📚 Documentation preview 📚: https://meltano-sdk--1602.org.readthedocs.build/en/1602/

@codecov
Copy link

codecov bot commented Apr 11, 2023

Codecov Report

Merging #1602 (7b2520b) into main (21d0a14) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1602   +/-   ##
=======================================
  Coverage   86.18%   86.18%           
=======================================
  Files          58       58           
  Lines        4747     4750    +3     
  Branches      797      798    +1     
=======================================
+ Hits         4091     4094    +3     
  Misses        465      465           
  Partials      191      191           
Impacted Files Coverage Δ
singer_sdk/typing.py 94.92% <100.00%> (+0.07%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@edgarrmondragon
Copy link
Collaborator

edgarrmondragon commented Apr 12, 2023

Hey @TyShkan, thanks for the PR!

The main problem I see with this approach is that it prohibits adding those extra properties to the wrapping ArrayType. Think of these two samples:

{"type": "array", "items": {"type": "string", "enum": ["a", "b"]}}

and

{"type": "array", "items": {"type": "string"}, "enum": [["a", "b"], ["b", "c"]]}

Both are valid, but the second one can't be constructed. I have a solution using a modified descriptor and will open a PR in a few.

EDIT: #1603

@TyShkan
Copy link
Author

TyShkan commented Apr 12, 2023

@edgarrmondragon Yep! That makes sense, the solution works great and definitely much more flexible. Thanks! Would be great to see it in the next version (:

@TyShkan TyShkan closed this Apr 12, 2023
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

Successfully merging this pull request may close these issues.

feat: extend allowed_values option of JSONSchema for Property(ArrayType)
3 participants