Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Merge requests
  • !7717

[cpp-restbed-server] Allow to implement validation of input data for enumerations

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/f18m/cpp-restbed-model-api-fix into master Oct 14, 2020
  • Overview 0
  • Commits 3
  • Pipelines 0
  • Changes 6

Created by: f18m

This MR modifies the MODEL C++ source code to throw an exception whenever trying to set an unsupported enum value inside the model class, instead of silently dropping the set() command.

This is consistent with the usage for the c++ restbed server of Boost::ptree which already throws exceptions in case of invalid data type translations (see https://www.boost.org/doc/libs/1_74_0/boost/property_tree/exceptions.hpp)

With this MR the caller can detect invalid JSON/schema provided as input to the REST APIs just by catching std::runtime_error exceptions. A possible improvement would be introducing a custom class for such exceptions...

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/f18m/cpp-restbed-model-api-fix