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

JSON comparison system - refactor APIs to only allow valid JSON types #118

Open
timkimadobe opened this issue Oct 13, 2023 · 0 comments
Open
Labels
task Item that can be completed as a standalone code change or is part of an epic.Used by issue template

Comments

@timkimadobe
Copy link
Contributor

Task description

Currently the JSON comparison assertion public APIs are too permissive where they allow for any incoming types:

  1. It's more confusing at the call site what types to use
  2. It allows for known invalid comparisons (at the call site)

An immediate solution could be only allowing JSONObject == JSONObject and JSONArray == JSONArray comparisons as the API param types

A future looking solution could be something like creating a sealed class (that works like a union type) that can create a better type interface for mixing and matching types, especially if the feature of allowing custom validation start point paths is implemented

Additional implementation details or code snippet(s)

No response

@timkimadobe timkimadobe added the task Item that can be completed as a standalone code change or is part of an epic.Used by issue template label Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task Item that can be completed as a standalone code change or is part of an epic.Used by issue template
Projects
None yet
Development

No branches or pull requests

1 participant