ory / ory/sdk

[Dart ory_kratos_client] Unable to build `Update...FlowBody`

Open
#290 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PHP
Stars
178
Forks
96
Avg merge
6d 23h
Merged PRs (30d)
3

Description

Preflight checklist
Ory Network Project

No response

Describe the bug

updateRegistrationFlowBody requires

  • flow - Flow ID as string
  • updateRegistrationFlowBody - builder function to create flow body

Unfortunately creating UpdateRegistrationFlowBody provides only oneOf, whereas auto-generated docs describe the required for me arguments like method, traits and so on.

I have tried creating flow body with following snippets with no success:

1
  final body = UpdateRegistrationFlowBody((b) => b
    ..oneOf = UpdateRegistrationFlowWithPasswordMethod((p) => p
      ..password = password
      ..traits = Traits((t) => t..email = email)));

  kratosClient
      .updateRegistrationFlow(
        flow: registrationFlow.id,
        updateRegistrationFlowBody: body,
      )
2
final body = UpdateRegistrationFlowBody((b) => b
  ..oneOf = OneOf<UpdateRegistrationFlowWithPasswordMethod>.of(
    UpdateRegistrationFlowWithPasswordMethod(
      (b) => b..password = password
    )
  )
);

This package however provides needed function to create flow body - SubmitSelfServiceRegistrationFlowBody

Reproducing the bug
  1. Create RegistrationFlow
  2. Try to update its body
Relevant log output

No response

Relevant configuration

No response

Version

0.13.1

On which operating system are you observing this issue?

macOS

In which environment are you deploying?

None

Additional Context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with clients/kratos/dart/doc/UpdateRegistrationFlowBody.md and the generated UpdateRegistrationFlowBody model, then trace the updateRegistrationFlow entry point. Compare its available construction API with the documented method and traits fields and the SubmitSelfServiceRegistrationFlowBody example mentioned in the report. Done means the documented registration update body can be constructed and passed to updateRegistrationFlow successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.