Discussion:
[jira] [Created] (ISIS-2034) REST operations return empty response
Brian Kalbfus (JIRA)
2018-11-16 19:46:00 UTC
Permalink
Brian Kalbfus created ISIS-2034:
-----------------------------------

Summary: REST operations return empty response
Key: ISIS-2034
URL: https://issues.apache.org/jira/browse/ISIS-2034
Project: Isis
Issue Type: Bug
Components: Core: Viewer: RestfulObjects
Affects Versions: 2.0.0-M2
Environment: Windows 7
Reporter: Brian Kalbfus


to reproduce:
# checkout HEAD of v2 branch
# mvn clean install
# cd to isis/example/application/simpleapp/webapp
# set PROTOTYPING=true
# mvn jetty:run
# open web browser to localhost:8080/wicket, sign in as sven/pass
# from prototyping menu, open swagger-ui
# reload private spec
# select simple - /service/simple.SimpleObjectMenu/actions/listAll/invoke
# click "Try it out"

expected:  Response body should have some output - some json with metadata or something

actual: Reponse body says "no content"



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
Andi Huber (JIRA)
2018-11-17 05:57:00 UTC
Permalink
[ https://issues.apache.org/jira/browse/ISIS-2034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16690393#comment-16690393 ]

Andi Huber commented on ISIS-2034:
----------------------------------

Hi Brian,
can you confirm, that once you create at least a single SimpleObject, the REST endpoint '/service/simple.SimpleObjectMenu/actions/listAll/invoke' also does return this SimpleObject? At least, that's what I found.

Following your steps to reproduce does not include a step, where you would create any SimpleObject, hence the 'listAll' is empty.

In case, you wonder why: The simple-app defaults to an in memory DB, which on every fresh start of the app is empty.

Cheers, Andi!
Post by Brian Kalbfus (JIRA)
REST operations return empty response
-------------------------------------
Key: ISIS-2034
URL: https://issues.apache.org/jira/browse/ISIS-2034
Project: Isis
Issue Type: Bug
Components: Core: Viewer: RestfulObjects
Affects Versions: 2.0.0-M2
Environment: Windows 7
Reporter: Brian Kalbfus
Assignee: Andi Huber
Priority: Major
# checkout HEAD of v2 branch
# mvn clean install
# cd to isis/example/application/simpleapp/webapp
# set PROTOTYPING=true
# mvn jetty:run
# open web browser to localhost:8080/wicket, sign in as sven/pass
# from prototyping menu, open swagger-ui
# reload private spec
# select simple - /service/simple.SimpleObjectMenu/actions/listAll/invoke
# click "Try it out"
expected:  Response body should have some output - some json with metadata or something
actual: Reponse body says "no content"
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
Andi Huber (JIRA)
2018-11-17 05:57:00 UTC
Permalink
[ https://issues.apache.org/jira/browse/ISIS-2034?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andi Huber reassigned ISIS-2034:
--------------------------------

Assignee: Andi Huber
Post by Brian Kalbfus (JIRA)
REST operations return empty response
-------------------------------------
Key: ISIS-2034
URL: https://issues.apache.org/jira/browse/ISIS-2034
Project: Isis
Issue Type: Bug
Components: Core: Viewer: RestfulObjects
Affects Versions: 2.0.0-M2
Environment: Windows 7
Reporter: Brian Kalbfus
Assignee: Andi Huber
Priority: Major
# checkout HEAD of v2 branch
# mvn clean install
# cd to isis/example/application/simpleapp/webapp
# set PROTOTYPING=true
# mvn jetty:run
# open web browser to localhost:8080/wicket, sign in as sven/pass
# from prototyping menu, open swagger-ui
# reload private spec
# select simple - /service/simple.SimpleObjectMenu/actions/listAll/invoke
# click "Try it out"
expected:  Response body should have some output - some json with metadata or something
actual: Reponse body says "no content"
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
Andi Huber (JIRA)
2018-11-17 06:00:00 UTC
Permalink
[ https://issues.apache.org/jira/browse/ISIS-2034?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andi Huber updated ISIS-2034:
-----------------------------
Labels: not-an-issue (was: )
Post by Brian Kalbfus (JIRA)
REST operations return empty response
-------------------------------------
Key: ISIS-2034
URL: https://issues.apache.org/jira/browse/ISIS-2034
Project: Isis
Issue Type: Bug
Components: Core: Viewer: RestfulObjects
Affects Versions: 2.0.0-M2
Environment: Windows 7
Reporter: Brian Kalbfus
Assignee: Andi Huber
Priority: Major
Labels: not-an-issue
Fix For: 2.0.0-M2
# checkout HEAD of v2 branch
# mvn clean install
# cd to isis/example/application/simpleapp/webapp
# set PROTOTYPING=true
# mvn jetty:run
# open web browser to localhost:8080/wicket, sign in as sven/pass
# from prototyping menu, open swagger-ui
# reload private spec
# select simple - /service/simple.SimpleObjectMenu/actions/listAll/invoke
# click "Try it out"
expected:  Response body should have some output - some json with metadata or something
actual: Reponse body says "no content"
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
Andi Huber (JIRA)
2018-11-17 06:01:00 UTC
Permalink
[ https://issues.apache.org/jira/browse/ISIS-2034?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andi Huber updated ISIS-2034:
-----------------------------
Priority: Minor (was: Major)
Post by Brian Kalbfus (JIRA)
REST operations return empty response
-------------------------------------
Key: ISIS-2034
URL: https://issues.apache.org/jira/browse/ISIS-2034
Project: Isis
Issue Type: Bug
Components: Core: Viewer: RestfulObjects
Affects Versions: 2.0.0-M2
Environment: Windows 7
Reporter: Brian Kalbfus
Assignee: Andi Huber
Priority: Minor
Labels: not-an-issue
Fix For: 2.0.0-M2
# checkout HEAD of v2 branch
# mvn clean install
# cd to isis/example/application/simpleapp/webapp
# set PROTOTYPING=true
# mvn jetty:run
# open web browser to localhost:8080/wicket, sign in as sven/pass
# from prototyping menu, open swagger-ui
# reload private spec
# select simple - /service/simple.SimpleObjectMenu/actions/listAll/invoke
# click "Try it out"
expected:  Response body should have some output - some json with metadata or something
actual: Reponse body says "no content"
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
Andi Huber (JIRA)
2018-11-17 05:59:00 UTC
Permalink
[ https://issues.apache.org/jira/browse/ISIS-2034?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andi Huber updated ISIS-2034:
-----------------------------
Fix Version/s: 2.0.0-M2
Post by Brian Kalbfus (JIRA)
REST operations return empty response
-------------------------------------
Key: ISIS-2034
URL: https://issues.apache.org/jira/browse/ISIS-2034
Project: Isis
Issue Type: Bug
Components: Core: Viewer: RestfulObjects
Affects Versions: 2.0.0-M2
Environment: Windows 7
Reporter: Brian Kalbfus
Assignee: Andi Huber
Priority: Major
Fix For: 2.0.0-M2
# checkout HEAD of v2 branch
# mvn clean install
# cd to isis/example/application/simpleapp/webapp
# set PROTOTYPING=true
# mvn jetty:run
# open web browser to localhost:8080/wicket, sign in as sven/pass
# from prototyping menu, open swagger-ui
# reload private spec
# select simple - /service/simple.SimpleObjectMenu/actions/listAll/invoke
# click "Try it out"
expected:  Response body should have some output - some json with metadata or something
actual: Reponse body says "no content"
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
Brian Kalbfus (JIRA)
2018-11-19 19:20:00 UTC
Permalink
[ https://issues.apache.org/jira/browse/ISIS-2034?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brian Kalbfus updated ISIS-2034:
--------------------------------
Attachment: simpleappswaggerui.png
Post by Brian Kalbfus (JIRA)
REST operations return empty response
-------------------------------------
Key: ISIS-2034
URL: https://issues.apache.org/jira/browse/ISIS-2034
Project: Isis
Issue Type: Bug
Components: Core: Viewer: RestfulObjects
Affects Versions: 2.0.0-M2
Environment: Windows 7
Reporter: Brian Kalbfus
Assignee: Andi Huber
Priority: Minor
Labels: not-an-issue
Fix For: 2.0.0-M2
Attachments: simpleappswaggerui.png
# checkout HEAD of v2 branch
# mvn clean install
# cd to isis/example/application/simpleapp/webapp
# set PROTOTYPING=true
# mvn jetty:run
# open web browser to localhost:8080/wicket, sign in as sven/pass
# from prototyping menu, open swagger-ui
# reload private spec
# select simple - /service/simple.SimpleObjectMenu/actions/listAll/invoke
# click "Try it out"
expected:  Response body should have some output - some json with metadata or something
actual: Reponse body says "no content"
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
Brian Kalbfus (JIRA)
2018-11-19 19:40:00 UTC
Permalink
[ https://issues.apache.org/jira/browse/ISIS-2034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16692159#comment-16692159 ]

Brian Kalbfus commented on ISIS-2034:
-------------------------------------

Hi Andi,

It gives me the same result if I create SimpleObject instances.  See attached screenshot.  If there are no instances, I'd expect there would be returned an empty list.  I just did 'git pull' and rebuilt the simpleapp; I have the same result.

Thanks,

Brian
Post by Brian Kalbfus (JIRA)
REST operations return empty response
-------------------------------------
Key: ISIS-2034
URL: https://issues.apache.org/jira/browse/ISIS-2034
Project: Isis
Issue Type: Bug
Components: Core: Viewer: RestfulObjects
Affects Versions: 2.0.0-M2
Environment: Windows 7
Reporter: Brian Kalbfus
Assignee: Andi Huber
Priority: Minor
Labels: not-an-issue
Fix For: 2.0.0-M2
Attachments: simpleappswaggerui.png
# checkout HEAD of v2 branch
# mvn clean install
# cd to isis/example/application/simpleapp/webapp
# set PROTOTYPING=true
# mvn jetty:run
# open web browser to localhost:8080/wicket, sign in as sven/pass
# from prototyping menu, open swagger-ui
# reload private spec
# select simple - /service/simple.SimpleObjectMenu/actions/listAll/invoke
# click "Try it out"
expected:  Response body should have some output - some json with metadata or something
actual: Reponse body says "no content"
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
Brian Kalbfus (JIRA)
2018-11-19 19:43:00 UTC
Permalink
[ https://issues.apache.org/jira/browse/ISIS-2034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16692159#comment-16692159 ]

Brian Kalbfus edited comment on ISIS-2034 at 11/19/18 7:42 PM:
---------------------------------------------------------------

Hi Andi,

It gives me the same result if I create SimpleObject instances.  See attached screenshot.  If there are no instances, I'd expect there would be returned an empty list.  I just did 'git pull' and rebuilt the simpleapp; I have the same result.  The HTTP status code (missing from screenshot) is 401.

Thanks,

Brian


was (Author: bkalbfus):
Hi Andi,

It gives me the same result if I create SimpleObject instances.  See attached screenshot.  If there are no instances, I'd expect there would be returned an empty list.  I just did 'git pull' and rebuilt the simpleapp; I have the same result.

Thanks,

Brian
Post by Brian Kalbfus (JIRA)
REST operations return empty response
-------------------------------------
Key: ISIS-2034
URL: https://issues.apache.org/jira/browse/ISIS-2034
Project: Isis
Issue Type: Bug
Components: Core: Viewer: RestfulObjects
Affects Versions: 2.0.0-M2
Environment: Windows 7
Reporter: Brian Kalbfus
Assignee: Andi Huber
Priority: Minor
Labels: not-an-issue
Fix For: 2.0.0-M2
Attachments: simpleappswaggerui.png
# checkout HEAD of v2 branch
# mvn clean install
# cd to isis/example/application/simpleapp/webapp
# set PROTOTYPING=true
# mvn jetty:run
# open web browser to localhost:8080/wicket, sign in as sven/pass
# from prototyping menu, open swagger-ui
# reload private spec
# select simple - /service/simple.SimpleObjectMenu/actions/listAll/invoke
# click "Try it out"
expected:  Response body should have some output - some json with metadata or something
actual: Reponse body says "no content"
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
Andi Huber (JIRA)
2018-11-19 20:15:00 UTC
Permalink
[ https://issues.apache.org/jira/browse/ISIS-2034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16692205#comment-16692205 ]

Andi Huber commented on ISIS-2034:
----------------------------------

Response code 401 is 'unauthorized', so thats the problem here.

You might notice that I've added a link on the swagger-ui top bar labeled 'Direct API Link (Login)' which points to the restful servlet's base URL '<context-path>/restful/'. You need to authorize once with Basic Auth (sven:pass), to get access to the restful viewer. After that everything should work.
Post by Brian Kalbfus (JIRA)
REST operations return empty response
-------------------------------------
Key: ISIS-2034
URL: https://issues.apache.org/jira/browse/ISIS-2034
Project: Isis
Issue Type: Bug
Components: Core: Viewer: RestfulObjects
Affects Versions: 2.0.0-M2
Environment: Windows 7
Reporter: Brian Kalbfus
Assignee: Andi Huber
Priority: Minor
Labels: not-an-issue
Fix For: 2.0.0-M2
Attachments: simpleappswaggerui.png
# checkout HEAD of v2 branch
# mvn clean install
# cd to isis/example/application/simpleapp/webapp
# set PROTOTYPING=true
# mvn jetty:run
# open web browser to localhost:8080/wicket, sign in as sven/pass
# from prototyping menu, open swagger-ui
# reload private spec
# select simple - /service/simple.SimpleObjectMenu/actions/listAll/invoke
# click "Try it out"
expected:  Response body should have some output - some json with metadata or something
actual: Reponse body says "no content"
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
Brian Kalbfus (JIRA)
2018-11-19 23:13:00 UTC
Permalink
[ https://issues.apache.org/jira/browse/ISIS-2034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16692407#comment-16692407 ]

Brian Kalbfus commented on ISIS-2034:
-------------------------------------

OK, that did it.  I see you are using cookie authentication now.  The curl command displayed isn't accurate if you have to include a cookie in the process.  Maybe modifying the api specification document (/restful/swagger/private) will work better with Swagger-UI and generated clients.  You can add a security scheme like is described in [https://swagger.io/docs/specification/authentication/cookie-authentication/]  .  

Thanks!

Brian
Post by Brian Kalbfus (JIRA)
REST operations return empty response
-------------------------------------
Key: ISIS-2034
URL: https://issues.apache.org/jira/browse/ISIS-2034
Project: Isis
Issue Type: Bug
Components: Core: Viewer: RestfulObjects
Affects Versions: 2.0.0-M2
Environment: Windows 7
Reporter: Brian Kalbfus
Assignee: Andi Huber
Priority: Minor
Labels: not-an-issue
Fix For: 2.0.0-M2
Attachments: simpleappswaggerui.png
# checkout HEAD of v2 branch
# mvn clean install
# cd to isis/example/application/simpleapp/webapp
# set PROTOTYPING=true
# mvn jetty:run
# open web browser to localhost:8080/wicket, sign in as sven/pass
# from prototyping menu, open swagger-ui
# reload private spec
# select simple - /service/simple.SimpleObjectMenu/actions/listAll/invoke
# click "Try it out"
expected:  Response body should have some output - some json with metadata or something
actual: Reponse body says "no content"
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
Andi Huber (JIRA)
2018-11-20 05:51:00 UTC
Permalink
[ https://issues.apache.org/jira/browse/ISIS-2034?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andi Huber updated ISIS-2034:
-----------------------------
Summary: [NOT A PROBLEM] REST operations return empty response (was: REST operations return empty response)
[NOT A PROBLEM] REST operations return empty response
-----------------------------------------------------
Key: ISIS-2034
URL: https://issues.apache.org/jira/browse/ISIS-2034
Project: Isis
Issue Type: Bug
Components: Core: Viewer: RestfulObjects
Affects Versions: 2.0.0-M2
Environment: Windows 7
Reporter: Brian Kalbfus
Assignee: Andi Huber
Priority: Minor
Labels: not-an-issue
Fix For: 2.0.0-M2
Attachments: simpleappswaggerui.png
# checkout HEAD of v2 branch
# mvn clean install
# cd to isis/example/application/simpleapp/webapp
# set PROTOTYPING=true
# mvn jetty:run
# open web browser to localhost:8080/wicket, sign in as sven/pass
# from prototyping menu, open swagger-ui
# reload private spec
# select simple - /service/simple.SimpleObjectMenu/actions/listAll/invoke
# click "Try it out"
expected:  Response body should have some output - some json with metadata or something
actual: Reponse body says "no content"
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
Andi Huber (JIRA)
2018-11-20 06:00:00 UTC
Permalink
[ https://issues.apache.org/jira/browse/ISIS-2034?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andi Huber closed ISIS-2034.
----------------------------
Resolution: Not A Problem

Thanks Brian!

Thing is, in general, we have no idea about what actual authentication mechanism protects the restful viewer. This is up the deployment scenario. Hence our customized swagger-ui does simply ignore this aspect. I'm afraid, that's the best we can do on our side.

Cheers Andi!
Post by Andi Huber (JIRA)
[NOT A PROBLEM] REST operations return empty response
-----------------------------------------------------
Key: ISIS-2034
URL: https://issues.apache.org/jira/browse/ISIS-2034
Project: Isis
Issue Type: Bug
Components: Core: Viewer: RestfulObjects
Affects Versions: 2.0.0-M2
Environment: Windows 7
Reporter: Brian Kalbfus
Assignee: Andi Huber
Priority: Minor
Labels: not-an-issue
Fix For: 2.0.0-M2
Attachments: simpleappswaggerui.png
# checkout HEAD of v2 branch
# mvn clean install
# cd to isis/example/application/simpleapp/webapp
# set PROTOTYPING=true
# mvn jetty:run
# open web browser to localhost:8080/wicket, sign in as sven/pass
# from prototyping menu, open swagger-ui
# reload private spec
# select simple - /service/simple.SimpleObjectMenu/actions/listAll/invoke
# click "Try it out"
expected:  Response body should have some output - some json with metadata or something
actual: Reponse body says "no content"
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
Andi Huber (JIRA)
2018-11-20 06:11:00 UTC
Permalink
[ https://issues.apache.org/jira/browse/ISIS-2034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16692714#comment-16692714 ]

Andi Huber commented on ISIS-2034:
----------------------------------

Also note, that for the 'simpleapp' basic-auth should work with curl as well.
Post by Andi Huber (JIRA)
[NOT A PROBLEM] REST operations return empty response
-----------------------------------------------------
Key: ISIS-2034
URL: https://issues.apache.org/jira/browse/ISIS-2034
Project: Isis
Issue Type: Bug
Components: Core: Viewer: RestfulObjects
Affects Versions: 2.0.0-M2
Environment: Windows 7
Reporter: Brian Kalbfus
Assignee: Andi Huber
Priority: Minor
Labels: not-an-issue
Fix For: 2.0.0-M2
Attachments: simpleappswaggerui.png
# checkout HEAD of v2 branch
# mvn clean install
# cd to isis/example/application/simpleapp/webapp
# set PROTOTYPING=true
# mvn jetty:run
# open web browser to localhost:8080/wicket, sign in as sven/pass
# from prototyping menu, open swagger-ui
# reload private spec
# select simple - /service/simple.SimpleObjectMenu/actions/listAll/invoke
# click "Try it out"
expected:  Response body should have some output - some json with metadata or something
actual: Reponse body says "no content"
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Loading...