AeroGear
  1. AeroGear
  2. AEROGEAR-380

TODO app: creating a project requires all attributes (title and style)

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved (View Workflow)
    • Priority: Major Major
    • Resolution: Done
    • Affects Version/s: 1.0.0.M5
    • Fix Version/s: 1.0.0.M5
    • Component/s: None
    • Security Level: Public (Everyone can see)
    • Labels:
      None
    • Similar Issues:
      Show 10 results 

      Description

      Using (in CURL) some JSON like this:

       {"title":"my title"}
      

      does not work; it needs the style as well...

      in iOS I am (for now), doing this:

      ...
         [parameters setValue:@"My Project" forKey:@"title"];
         [parameters setValue:@"project-255-255-255" forKey:@"style"];
      ...
      

        Activity

        Hide
        Bruno Oliveira
        added a comment - - edited

        Hi Matthias, I did few tests with the recent changes, the issue doesn't exist anymore. Check it out.

        # Projects
        
        curl -v -H "Content-type: application/json" -X POST -d '{"title":"my titile"}' http://localhost:8080/todo-server/project/
        curl -v -H "Content-type: application/json" -X POST -d '{"style":"fancy"}' http://localhost:8080/todo-server/project/
        
        curl -v -H "Content-type: application/json" -X PUT -d '{"title":"matthias gone"}' http://localhost:8080/todo-server/project/1
        curl -v -H "Content-type: application/json" -X PUT -d '{"style":"superfancy"}' http://localhost:8080/todo-server/project/2
        
        curl -v -H "Content-type: application/json" -X GET http://localhost:8080/todo-server/project
        
        # Tags
        
        curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"title":"tag1"}' http://localhost:8080/todo-server/tag/
        curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"style":"fancy2"}' http://localhost:8080/todo-server/tag/
        
        curl -v -H "Accept: application/json" -H "Content-type: application/json" -X PUT -d '{"title":"guten tag"}' http://localhost:8080/todo-server/tag/1
        curl -v -H "Accept: application/json" -H "Content-type: application/json" -X PUT -d '{"style":"fancyfancy"}' http://localhost:8080/todo-server/tag/2
        
        curl -v -H "Content-type: application/json" -X GET http://localhost:8080/todo-server/tag
        
        # Tasks
        
        curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"title":"Test POST1"}' http://localhost:8080/todo-server/task
        curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"date":"2012-08-08"}' http://localhost:8080/todo-server/task
        curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"description":"This is test data for abstractj :)"}' http://localhost:8080/todo-server/task
        curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"tags":[1,2]' http://localhost:8080/todo-server/task
        curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"project":1}' http://localhost:8080/todo-server/task
        
        curl -v -H "Accept: application/json" -H "Content-type: application/json" -X PUT -d '{"title":"zomg"}' http://localhost:8080/todo-server/task/1
        curl -v -H "Accept: application/json" -H "Content-type: application/json" -X PUT -d '{"date":"2012-12-12"}' http://localhost:8080/todo-server/task/2
        curl -v -H "Accept: application/json" -H "Content-type: application/json" -X PUT -d '{"description":"This is test data for matthias :)"}' http://localhost:8080/todo-server/task/3
        curl -v -H "Accept: application/json" -H "Content-type: application/json" -X PUT -d '{"tags":[2]' http://localhost:8080/todo-server/task/4
        
        curl -v -H "Content-type: application/json" -X DELETE http://localhost:8080/todo-server/project/1
        curl -v -H "Content-type: application/json" -X DELETE http://localhost:8080/todo-server/project/2
        
        curl -v -H "Content-type: application/json" -X DELETE http://localhost:8080/todo-server/tag/1
        curl -v -H "Content-type: application/json" -X DELETE http://localhost:8080/todo-server/tag/2
        
        curl -v -H "Content-type: application/json" -X DELETE http://localhost:8080/todo-server/task/1
        curl -v -H "Content-type: application/json" -X DELETE http://localhost:8080/todo-server/task/2
        curl -v -H "Content-type: application/json" -X DELETE http://localhost:8080/todo-server/task/3
        curl -v -H "Content-type: application/json" -X DELETE http://localhost:8080/todo-server/task/4
        
        
        Show
        Bruno Oliveira
        added a comment - - edited Hi Matthias, I did few tests with the recent changes, the issue doesn't exist anymore. Check it out. # Projects curl -v -H "Content-type: application/json" -X POST -d '{"title":"my titile"}' http://localhost:8080/todo-server/project/ curl -v -H "Content-type: application/json" -X POST -d '{"style":"fancy"}' http://localhost:8080/todo-server/project/ curl -v -H "Content-type: application/json" -X PUT -d '{"title":"matthias gone"}' http://localhost:8080/todo-server/project/1 curl -v -H "Content-type: application/json" -X PUT -d '{"style":"superfancy"}' http://localhost:8080/todo-server/project/2 curl -v -H "Content-type: application/json" -X GET http://localhost:8080/todo-server/project # Tags curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"title":"tag1"}' http://localhost:8080/todo-server/tag/ curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"style":"fancy2"}' http://localhost:8080/todo-server/tag/ curl -v -H "Accept: application/json" -H "Content-type: application/json" -X PUT -d '{"title":"guten tag"}' http://localhost:8080/todo-server/tag/1 curl -v -H "Accept: application/json" -H "Content-type: application/json" -X PUT -d '{"style":"fancyfancy"}' http://localhost:8080/todo-server/tag/2 curl -v -H "Content-type: application/json" -X GET http://localhost:8080/todo-server/tag # Tasks curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"title":"Test POST1"}' http://localhost:8080/todo-server/task curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"date":"2012-08-08"}' http://localhost:8080/todo-server/task curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"description":"This is test data for abstractj :)"}' http://localhost:8080/todo-server/task curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"tags":[1,2]' http://localhost:8080/todo-server/task curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"project":1}' http://localhost:8080/todo-server/task curl -v -H "Accept: application/json" -H "Content-type: application/json" -X PUT -d '{"title":"zomg"}' http://localhost:8080/todo-server/task/1 curl -v -H "Accept: application/json" -H "Content-type: application/json" -X PUT -d '{"date":"2012-12-12"}' http://localhost:8080/todo-server/task/2 curl -v -H "Accept: application/json" -H "Content-type: application/json" -X PUT -d '{"description":"This is test data for matthias :)"}' http://localhost:8080/todo-server/task/3 curl -v -H "Accept: application/json" -H "Content-type: application/json" -X PUT -d '{"tags":[2]' http://localhost:8080/todo-server/task/4 curl -v -H "Content-type: application/json" -X DELETE http://localhost:8080/todo-server/project/1 curl -v -H "Content-type: application/json" -X DELETE http://localhost:8080/todo-server/project/2 curl -v -H "Content-type: application/json" -X DELETE http://localhost:8080/todo-server/tag/1 curl -v -H "Content-type: application/json" -X DELETE http://localhost:8080/todo-server/tag/2 curl -v -H "Content-type: application/json" -X DELETE http://localhost:8080/todo-server/task/1 curl -v -H "Content-type: application/json" -X DELETE http://localhost:8080/todo-server/task/2 curl -v -H "Content-type: application/json" -X DELETE http://localhost:8080/todo-server/task/3 curl -v -H "Content-type: application/json" -X DELETE http://localhost:8080/todo-server/task/4
        Hide
        Matthias Wessendorf
        added a comment -

        When creating a project without sending the style attribute the new project is NOT visible in the TODO-www app.

        HEre is the CURL command in question:

        curl -v -H "Content-type: application/json" -X POST -d '{"title":"A new project"}' http://localhost:8080/todo-server/project
        

        However applying an empty string value for the style attributes 'fixes' the problem

        curl -v -H "Content-type: application/json" -X POST -d '{"title":"A new project", "style":""}' http://localhost:8080/todo-server/project
        
        Show
        Matthias Wessendorf
        added a comment - When creating a project without sending the style attribute the new project is NOT visible in the TODO-www app. HEre is the CURL command in question: curl -v -H "Content-type: application/json" -X POST -d '{ "title" : "A new project" }' http: //localhost:8080/todo-server/project However applying an empty string value for the style attributes 'fixes' the problem curl -v -H "Content-type: application/json" -X POST -d '{ "title" : "A new project" , "style" :""}' http: //localhost:8080/todo-server/project
        Hide
        Kris Borchers
        added a comment -
        Show
        Kris Borchers
        added a comment - This should be fixed. Please review https://github.com/aerogear/TODO/commit/862ff6443fabd9ce4dc3461001becfb6e96c0a10
        Hide
        Matthias Wessendorf
        added a comment -

        This works!

        creating a new project, via curl:

        curl -v -H "Content-type: application/json" -X POST -d '{"title":"A pretty cool broject"}' http://localhost:8080/todo-server/projects
        

        works fine, and gives me this output:

        * About to connect() to localhost port 8080 (#0)
        *   Trying ::1...
        * Connection refused
        *   Trying 127.0.0.1...
        * connected
        * Connected to localhost (127.0.0.1) port 8080 (#0)
        > POST /todo-server/projects HTTP/1.1
        > User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8r zlib/1.2.5
        > Host: localhost:8080
        > Accept: */*
        > Content-type: application/json
        > Content-Length: 33
        > 
        * upload completely sent off: 33 out of 33 bytes
        < HTTP/1.1 200 OK
        < Server: Apache-Coyote/1.1
        < Content-Type: application/json
        < Transfer-Encoding: chunked
        < Date: Tue, 21 Aug 2012 06:34:20 GMT
        < 
        * Connection #0 to host localhost left intact
        {"id":3,"title":"A pretty cool broject","style":null,"tasks":[]}* Closing connection #0
        

        This worked already in the past.

        NOW, I can also see this new project in the TODO-www application.

        Show
        Matthias Wessendorf
        added a comment - This works! creating a new project, via curl: curl -v -H "Content-type: application/json" -X POST -d '{ "title" : "A pretty cool broject" }' http: //localhost:8080/todo-server/projects works fine, and gives me this output: * About to connect() to localhost port 8080 (#0) * Trying ::1... * Connection refused * Trying 127.0.0.1... * connected * Connected to localhost (127.0.0.1) port 8080 (#0) > POST /todo-server/projects HTTP/1.1 > User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8r zlib/1.2.5 > Host: localhost:8080 > Accept: */* > Content-type: application/json > Content-Length: 33 > * upload completely sent off: 33 out of 33 bytes < HTTP/1.1 200 OK < Server: Apache-Coyote/1.1 < Content-Type: application/json < Transfer-Encoding: chunked < Date: Tue, 21 Aug 2012 06:34:20 GMT < * Connection #0 to host localhost left intact { "id" :3, "title" : "A pretty cool broject" , "style" : null , "tasks" :[]}* Closing connection #0 This worked already in the past. NOW, I can also see this new project in the TODO-www application.
        Hide
        Matthias Wessendorf
        added a comment -

        problem fixed!

        Show
        Matthias Wessendorf
        added a comment - problem fixed!

          People

          • Assignee:
            Kris Borchers
            Reporter:
            Matthias Wessendorf
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: