Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-1851

Add jsonp provider for JsonString and JsonNumber

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Blocker Blocker
    • 3.5.1.Final, 4.0.0.Beta3
    • 4.0.0.Beta2, 3.5.0.Final
    • jaxrs
    • None

      jaxrs 2.1 spec says:
      In a product that supports the Java API for JSON Processing (JSON-P) [18], implementations MUST support
      entity providers for JsonValue and all of its sub-types: JsonStructure , JsonObject , JsonArray ,
      JsonString and JsonNumber .

      We should add provider for JsonSring and JsonNumber and read/write this type argument and return like :

      @Path("number")
      @POST
      @Consumes(MediaType.APPLICATION_JSON)
      @Produces(MediaType.APPLICATION_JSON)
      public JsonNumber testNumber(JsonNumber number)

      { return Json.createValue(number.intValue() + 100); }

      @Path("string")
      @POST
      @Consumes(MediaType.APPLICATION_JSON)
      @Produces(MediaType.APPLICATION_JSON)
      public JsonString testString(JsonString string)

      { return Json.createValue("Hello " + string.getString()); }

              rhn-engineering-ema Jim Ma
              rhn-engineering-ema Jim Ma
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: