Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • api api
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 4
    • Issues 4
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • cubicweb
  • cubes
  • apiapi
  • Merge requests
  • !7

Merged
Created May 27, 2022 by Arnaud Vergnet@avergnetMaintainer

feat: use pyramid decorators and rework error handling

  • Overview 9
  • Commits 4
  • Pipelines 6
  • Changes 6

Completely rewrites route creation to use pyramid decorators instead of contexes.

Also reworks the error handling to make it easier to choose what errors to catch and when. It now uses regular try...except blocks around the parts which could fail, and raises a pyramid HTTPError to return an HTTP error to the user.

As part of the error handling, this MR adds request parameter validation using marshmallow and marshmallow_dataclass. Using those libraries we can define dataclasses and convert them to a schema compatible with marshmallow and used to validate request parameters.

There is one breaking change in this MR: The /transaction endpoint is now split in 4 with /transaction/begin, /transaction/execute, /transaction/commit and /transaction/rollback. This was done in order to have static params. Before this change, request parameters would change based on the action param.

Closes #9 (closed)

Closes #5 (closed)

Closes #11 (closed)

Edited May 30, 2022 by Arnaud Vergnet
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: topic/default/architecture_rework