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
  • !8144

[Go][Server] Use the correct parameter name

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/randomswdev/fix-goserver-parameter-names into master Dec 09, 2020
  • Overview 0
  • Commits 2
  • Pipelines 0
  • Changes 4

Created by: randomswdev

Implementing two minor changes:

  1. When extracting the parameter value use baseName instead of paramName. The two variables usually are not different, but there is a difference in case the path parameter name includes a special character like a -. For example in: /api/resource/{resource-id} baseName is equal to resource-id, while paramName is eqaul to resourceId. Using the latter is incorrect.
  2. When failing to parse a parameter, like for example when the code expects an integer and parsing the integer fails, I would think it is more appropriate to return StatusBadParam isntead of StatusServerInternalError, because the failure was caused by the client sending invalid data and not because of an issue on the server.

@antihax @grokify @kemokemo @bkabrda

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/randomswdev/fix-goserver-parameter-names