Skip to content

Query string format validation#6

Open
viatrix wants to merge 3 commits into
devfrom
feat-resolving
Open

Query string format validation#6
viatrix wants to merge 3 commits into
devfrom
feat-resolving

Conversation

@viatrix

@viatrix viatrix commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

This PR adds validation of the input query string.
Validates that question matches the format <text>?[A1,A2,...,AN] and that
the parsed answer count equals numberOfOutcomes.

Strict structural checks:

  • ? must appear at least once.
  • [ must be the byte immediately after the first ?.
  • ] must be the last byte of the string.

Accepted limitations (gas trade-off):

  • Consecutive delimiters (?[A,,B]) and leading/trailing delimiters (?[A,],
    ?[,A]) over-count answers. Detecting empty tokens would require a second
    pass; the count is left to caller-side validation of numberOfOutcomes.
  • Whitespace is not trimmed and multi-byte UTF-8 sequences are not interpreted.

@viatrix viatrix requested a review from Xaleee June 22, 2026 09:38
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.

1 participant