Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • A AndroidAsync
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 333
    • Issues 333
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 19
    • Merge requests 19
  • 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
  • Koushik Dutta
  • AndroidAsync
  • Merge requests
  • !629

Refactor request JSON body

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/Swordsman-Inaction/refactor-request-json-body into master Dec 03, 2018
  • Overview 1
  • Commits 2
  • Pipelines 0
  • Changes 5

Created by: Swordsman-Inaction

Server currently cannot handle Json Array body. Because Json Array and Json Object share the same content-type, It's not possible to differentiate them in HttpUtil before the actual value is read.

So I removed JSONArrayBody (It's not used at all) and JSONObjectBody, then add new JSONTypeBody which supports both types.

Before: Get Json Object: json = ((JSONObjectBody)request.getBody()).get(); Get Json Array: No way

After: Get Json Object: json = ((JSONTypeBody) request.getBody()).getJsonObject(); Get Json Array: json = ((JSONTypeBody) request.getBody()). getJsonArray();

Warning: It's a BREAK change, do not merge it if you think it's not good enough.

Another thing, the link https://koush.clockworkmod.com/test/echo used in unit test doesn't work now, can you fix it?

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/Swordsman-Inaction/refactor-request-json-body