You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by th...@apache.org on 2021/12/02 18:33:12 UTC

[tapestry-5] branch rest updated: TAP5-2696: fixing JSON mime type in test code

This is an automated email from the ASF dual-hosted git repository.

thiagohp pushed a commit to branch rest
in repository https://gitbox.apache.org/repos/asf/tapestry-5.git


The following commit(s) were added to refs/heads/rest by this push:
     new 058410a  TAP5-2696: fixing JSON mime type in test code
058410a is described below

commit 058410ac11a640826f7ad351b51dd7cc0cb37b21
Author: Thiago H. de Paula Figueiredo <th...@arsmachina.com.br>
AuthorDate: Thu Dec 2 15:33:03 2021 -0300

    TAP5-2696: fixing JSON mime type in test code
---
 .../integration/app1/pages/rest/RestTypeDescriptionsDemo.java     | 8 ++++----
 .../integration/app1/pages/rest/RestWithOnEventDemo.java          | 6 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/rest/RestTypeDescriptionsDemo.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/rest/RestTypeDescriptionsDemo.java
index 0c6adf1..15fff92 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/rest/RestTypeDescriptionsDemo.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/rest/RestTypeDescriptionsDemo.java
@@ -23,19 +23,19 @@ import org.apache.tapestry5.json.JSONObject;
 /**
  * REST endpoint class just to test the parameter and return type descriptions.
  */
-@RestInfo(produces = "application/javascript")
+@RestInfo(produces = "application/json")
 public class RestTypeDescriptionsDemo {
 
     private static final String TEXT_PLAIN = "text/plain";
 
     @OnEvent(EventConstants.HTTP_GET)
-    @RestInfo(consumes = "application/javascript", produces = "application/javascript")
+    @RestInfo(consumes = "application/json", produces = "application/json")
     Object point(@StaticActivationContextValue("point") String ignored, Point p1, @RequestBody Point p2) {
         return null;
     }
     
     @OnEvent(EventConstants.HTTP_GET)
-    @RestInfo(returnType = JSONArray.class, consumes = "application/javascript", produces = "application/javascript")    
+    @RestInfo(returnType = JSONArray.class, consumes = "application/json", produces = "application/json")    
     Object jsonArray(
             @StaticActivationContextValue("jsonArray") String ignored, 
             JSONArray jsonArray1,
@@ -44,7 +44,7 @@ public class RestTypeDescriptionsDemo {
     }
     
     @OnEvent(EventConstants.HTTP_GET)
-    @RestInfo(returnType = JSONObject.class, consumes = "application/javascript", produces = "application/javascript")    
+    @RestInfo(returnType = JSONObject.class, consumes = "application/json", produces = "application/json")    
     Object jsonObject(@StaticActivationContextValue("jsonObject") String ignored, JSONObject jsonObject, @RequestBody JSONObject jsonObject2) {
         return null;
     }
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/rest/RestWithOnEventDemo.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/rest/RestWithOnEventDemo.java
index 1111c26..42dc2f1 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/rest/RestWithOnEventDemo.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/rest/RestWithOnEventDemo.java
@@ -40,7 +40,7 @@ public class RestWithOnEventDemo extends BaseRestDemoPage {
     }
 
     @OnEvent(EventConstants.HTTP_PATCH)
-    @RestInfo(consumes = "application/javascript")
+    @RestInfo(consumes = "application/json")
     Object patch(
             @StaticActivationContextValue(SUBPATH) String subpath, 
             String parameter, 
@@ -50,7 +50,7 @@ public class RestWithOnEventDemo extends BaseRestDemoPage {
     }
 
     @OnEvent(EventConstants.HTTP_POST)
-    @RestInfo(consumes = "application/javascript")
+    @RestInfo(consumes = "application/json")
     Object post(
             @StaticActivationContextValue(SUBPATH) String subpath, 
             String parameter, 
@@ -60,7 +60,7 @@ public class RestWithOnEventDemo extends BaseRestDemoPage {
     }
 
     @OnEvent(EventConstants.HTTP_PUT)
-    @RestInfo(consumes = "application/javascript")
+    @RestInfo(consumes = "application/json")
     Object put(
             @StaticActivationContextValue(SUBPATH) String subpath, 
             String parameter,