Uploaded image for project: 'Apache Lens (Retired)'
  1. Apache Lens (Retired)
  2. LENS-458 Code quality improvements
  3. LENS-483

Consistent way of receiving request data in REST APIs

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • None
    • None
    • server
    • None

    Description

      Lets take example of createCube and createFact.

      createCube accepts LensSessionHandle as query param and XCube as entity.

      @POST
      @Path("cubes")
      public APIResult createNewCube(@QueryParam("sessionid") LensSessionHandle sessionid, XCube cube)

      On the other hand, createFact consumes multi part form data and accepts LensSessionHandle and XFactTable as form data params.

      @Consumes(

      {MediaType.MULTIPART_FORM_DATA}

      )
      @POST
      @Path("/facts")
      public APIResult createFactTable(@FormDataParam("sessionid") LensSessionHandle sessionid, @FormDataParam("fact") XFactTable fact)

      createFact and createCube are logically similar but still have different ways of receiving request data in REST API.

      Logically similar APIs should choose same method to receive request data.

      Attachments

        Issue Links

          Activity

            People

              amareshwari Amareshwari Sriramadasu
              himanshu.gahlaut Himanshu Gahlaut
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: