Skip to content

bug(dynamic): ruleset PUT sends bare object — CT expects the [RuleSet] array envelope (server 500/TypeException) #77

Description

@2000game

Live dev rehearsal (#23, eqrm-dev, CT 3.134.1): applying a dynamic group's ruleset fails — CT responds with Swaggest\JsonSchema\Exception\TypeException: A server error occurred / \"Array expected, {…} received at #->properties:dynamicGroupRuleSet\".

The GET side has always returned a single-element ARRAY envelope ([RuleSet] — noted during the original #14 fixture capture), and evidently the PUT side expects the same envelope; ct-cli PUTs the bare ruleset object (src/engine — the dynamic synthetic-field apply path).

Also check: the #36 live-gated round-trip test (merged via PR #59, never yet run) PUTs a user-authored ruleset — make sure it goes through the same (fixed) code path rather than hand-building the body, or fix it too.

Fix: wrap the PUT body in the array envelope (match the GET shape exactly); pin with unit tests (PUT body asserted as [ruleset]); if there is any chance older CT accepted the bare object, prefer the array envelope per live evidence on 3.134.1 and note it.

Acceptance: unit test pins PUT /dynamicgroups/{id}/ruleset body = [ruleset]; the apply path that just failed live proceeds (mocked); #36's test path verified to use the same envelope.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions