Skip to content

Conversation

kinbiko
Copy link
Owner

@kinbiko kinbiko commented Jun 22, 2023

Tries to do #40 again, but with an up-to-date branch.

Discovered a key design issue I'd want to design around instead of accept any compromise.

Checklist

  • I have done a self-review of the PR.

@kinbiko kinbiko changed the title chore: bump go version containsf revisited Jun 23, 2023
@kinbiko kinbiko force-pushed the implement-containsf-revisited branch from 56580f8 to e30b006 Compare June 24, 2023 02:48
@kinbiko kinbiko force-pushed the implement-containsf-revisited branch from e30b006 to 67a29ac Compare June 24, 2023 02:54
// Currently, in the case of "Containsf" there's an implicit "<<UNORDERED>>" (if it's explicitly written it will be ignored)
// This is so that nested arrays don't have to repeatedly say "<<UNORDERED">> assuming the user just wants to check for the existence of some element of an array.
// However, this makes jsonassert useless for cases where you want to partially assert that an ordered array exists.
// Ideally this package should be able to support both nicely.
Copy link
Owner Author

@kinbiko kinbiko Jun 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idea 1

  • Assertf: Implicit "<<ORDERED>>", explicit "<<UNORDERED>>"
  • Containsf: Implicit "<<UNORDERED>>", explicit "<<ORDERED>>"

When *f is called with an implicit directive it is ignored.

When *f is called with an explicit directive it applies on only that array.

@kinbiko kinbiko linked an issue Feb 10, 2025 that may be closed by this pull request
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.

Feature Request: support for partial JSON matching
1 participant