You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Ivan Junckes Filho <iv...@gmail.com> on 2019/01/04 20:04:34 UTC

Re: TOMEE-2289

FYI I opened a PR on geronimo to fix the issue with text/html.

https://github.com/apache/geronimo-openapi/pull/4

Postman was working because it used */* and the implementation was properly
handling it, but not handling text/html.

On Thu, Jan 3, 2019 at 2:34 PM Ivan Junckes Filho <iv...@gmail.com>
wrote:

> Yes, the default content-type for browsers is text/html. I will submit a
> pr accepting that.
>
> On Thu, Jan 3, 2019 at 2:17 PM César Hernández Mendoza <
> cesarguate@gmail.com> wrote:
>
>> This  "default" behavior is also present in Metrics geronimo
>> implementation.
>> The issue is that the spec doesn't explicitly indicate the default
>> content-type requirement.
>>
>> El jue., 3 ene. 2019 a las 9:48, Ivan Junckes Filho (<
>> ivanjunckes@gmail.com>)
>> escribió:
>>
>> > I will take a look and help troubleshoot this.
>> >
>> > On Thu, Jan 3, 2019 at 12:08 PM Puneeth PS <pu...@gmail.com>
>> wrote:
>> >
>> > > Hi Ivan,
>> > >
>> > > /openapi works in POSTMAN client but not on browser, so might not be
>> an
>> > > issue.
>> > >
>> > > On Thu, Jan 3, 2019 at 6:38 PM Ivan Junckes Filho <
>> ivanjunckes@gmail.com
>> > >
>> > > wrote:
>> > >
>> > > > Hi Puneeth, I added a couple of more comments.
>> > > >
>> > > > There seems to have a couple of bugs in the openapi implementation.
>> > > >
>> > > > Json serialization bug and also /openapi is not working without the
>> > > header.
>> > > > So we may need to open bugs
>> > > > in https://issues.apache.org/jira/projects/GERONIMO/issues
>> > > > <https://issues.apache.org/jira/projects/GERONIMO/issues>.
>> > > >
>> > > > I will try to help troubleshoot these issues.
>> > > >
>> > > >
>> > > >
>> > > >
>> > > > On Thu, Jan 3, 2019 at 12:53 AM Puneeth PS <pu...@gmail.com>
>> > wrote:
>> > > >
>> > > > > Hi Ivan,
>> > > > >
>> > > > > I have made the changes requested and I've some questions
>> regarding
>> > the
>> > > > > spec which I've asked on the github thread, can you please clarify
>> > > these?
>> > > > >
>> > > > > On Wed 2 Jan, 2019, 6:09 PM Ivan Junckes Filho <
>> > ivanjunckes@gmail.com
>> > > > > wrote:
>> > > > >
>> > > > > > Puneeth, I did some comments here
>> > > > > >
>> > https://github.com/apache/tomee/pull/340#pullrequestreview-188661807
>> > > ,
>> > > > > > please take a look.
>> > > > > >
>> > > > > > On Wed, Jan 2, 2019 at 9:51 AM Ivan Junckes Filho <
>> > > > ivanjunckes@gmail.com
>> > > > > >
>> > > > > > wrote:
>> > > > > >
>> > > > > > > Hi Puneeth, I will review it for you.
>> > > > > > >
>> > > > > > > On Wed, Jan 2, 2019 at 8:39 AM Puneeth PS <
>> puneeth.ps@gmail.com>
>> > > > > wrote:
>> > > > > > >
>> > > > > > >> Hi,
>> > > > > > >>
>> > > > > > >> I have created a PR (
>> https://github.com/apache/tomee/pull/340
>> > )
>> > > > for
>> > > > > > >> TOMEE-2289. Can someone take a look and help me improve it?
>> > > > > > >>
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>>
>>
>> --
>> Atentamente:
>> César Hernández Mendoza.
>>
>

Re: TOMEE-2289

Posted by César Hernández Mendoza <ce...@gmail.com>.
I tested Ivan's PR.
From my point of view, if the specification doesn't limit this behavior,
then we can prevent first user frustration when they realize they can't
have a valid response if they execute the request from the browser.

This has the drawback to be able to send back an invalid
> response to the client (and break it)

I didn't understand how this can happen with current Ivan's PR.

El vie., 4 ene. 2019 a las 14:57, Romain Manni-Bucau (<rm...@gmail.com>)
escribió:

> Hi Ivan
>
> For the browser usage /openapi.json or /openapi.yaml will solve it nicely
>
> On master we ensure to respect the request expected type - it is fine to
> serialize it as html, this is even a way to implement a UI for it ;) - but
> we also ensure there is a writer instead of assuming the user request will
> work (new). This has the drawback to be able to send back an invalid
> response to the client (and break it) but since the spec doesn't define
> what to do in that case (guess it should just do nothing and let JAX-RS
> handle it otherwise microprofile wouldn't be JAX-RS based anymore) and
> defines that yaml is supposed to be the default then we are in a grey
> enough area to make you happy ;). Worse case we would revert it but it is
> not a prod usage for sure so no big deal for now.
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> <https://rmannibucau.metawerx.net/> | Old Blog
> <http://rmannibucau.wordpress.com> | Github <
> https://github.com/rmannibucau> |
> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> <
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> >
>
>
> Le ven. 4 janv. 2019 à 21:04, Ivan Junckes Filho <iv...@gmail.com> a
> écrit :
>
> > FYI I opened a PR on geronimo to fix the issue with text/html.
> >
> > https://github.com/apache/geronimo-openapi/pull/4
> >
> > Postman was working because it used */* and the implementation was
> > properly handling it, but not handling text/html.
> >
> > On Thu, Jan 3, 2019 at 2:34 PM Ivan Junckes Filho <ivanjunckes@gmail.com
> >
> > wrote:
> >
> >> Yes, the default content-type for browsers is text/html. I will submit a
> >> pr accepting that.
> >>
> >> On Thu, Jan 3, 2019 at 2:17 PM César Hernández Mendoza <
> >> cesarguate@gmail.com> wrote:
> >>
> >>> This  "default" behavior is also present in Metrics geronimo
> >>> implementation.
> >>> The issue is that the spec doesn't explicitly indicate the default
> >>> content-type requirement.
> >>>
> >>> El jue., 3 ene. 2019 a las 9:48, Ivan Junckes Filho (<
> >>> ivanjunckes@gmail.com>)
> >>> escribió:
> >>>
> >>> > I will take a look and help troubleshoot this.
> >>> >
> >>> > On Thu, Jan 3, 2019 at 12:08 PM Puneeth PS <pu...@gmail.com>
> >>> wrote:
> >>> >
> >>> > > Hi Ivan,
> >>> > >
> >>> > > /openapi works in POSTMAN client but not on browser, so might not
> be
> >>> an
> >>> > > issue.
> >>> > >
> >>> > > On Thu, Jan 3, 2019 at 6:38 PM Ivan Junckes Filho <
> >>> ivanjunckes@gmail.com
> >>> > >
> >>> > > wrote:
> >>> > >
> >>> > > > Hi Puneeth, I added a couple of more comments.
> >>> > > >
> >>> > > > There seems to have a couple of bugs in the openapi
> implementation.
> >>> > > >
> >>> > > > Json serialization bug and also /openapi is not working without
> the
> >>> > > header.
> >>> > > > So we may need to open bugs
> >>> > > > in https://issues.apache.org/jira/projects/GERONIMO/issues
> >>> > > > <https://issues.apache.org/jira/projects/GERONIMO/issues>.
> >>> > > >
> >>> > > > I will try to help troubleshoot these issues.
> >>> > > >
> >>> > > >
> >>> > > >
> >>> > > >
> >>> > > > On Thu, Jan 3, 2019 at 12:53 AM Puneeth PS <puneeth.ps@gmail.com
> >
> >>> > wrote:
> >>> > > >
> >>> > > > > Hi Ivan,
> >>> > > > >
> >>> > > > > I have made the changes requested and I've some questions
> >>> regarding
> >>> > the
> >>> > > > > spec which I've asked on the github thread, can you please
> >>> clarify
> >>> > > these?
> >>> > > > >
> >>> > > > > On Wed 2 Jan, 2019, 6:09 PM Ivan Junckes Filho <
> >>> > ivanjunckes@gmail.com
> >>> > > > > wrote:
> >>> > > > >
> >>> > > > > > Puneeth, I did some comments here
> >>> > > > > >
> >>> > https://github.com/apache/tomee/pull/340#pullrequestreview-188661807
> >>> > > ,
> >>> > > > > > please take a look.
> >>> > > > > >
> >>> > > > > > On Wed, Jan 2, 2019 at 9:51 AM Ivan Junckes Filho <
> >>> > > > ivanjunckes@gmail.com
> >>> > > > > >
> >>> > > > > > wrote:
> >>> > > > > >
> >>> > > > > > > Hi Puneeth, I will review it for you.
> >>> > > > > > >
> >>> > > > > > > On Wed, Jan 2, 2019 at 8:39 AM Puneeth PS <
> >>> puneeth.ps@gmail.com>
> >>> > > > > wrote:
> >>> > > > > > >
> >>> > > > > > >> Hi,
> >>> > > > > > >>
> >>> > > > > > >> I have created a PR (
> >>> https://github.com/apache/tomee/pull/340
> >>> > )
> >>> > > > for
> >>> > > > > > >> TOMEE-2289. Can someone take a look and help me improve
> it?
> >>> > > > > > >>
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> >>>
> >>> --
> >>> Atentamente:
> >>> César Hernández Mendoza.
> >>>
> >>
>


-- 
Atentamente:
César Hernández Mendoza.

Re: TOMEE-2289

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi Ivan

For the browser usage /openapi.json or /openapi.yaml will solve it nicely

On master we ensure to respect the request expected type - it is fine to
serialize it as html, this is even a way to implement a UI for it ;) - but
we also ensure there is a writer instead of assuming the user request will
work (new). This has the drawback to be able to send back an invalid
response to the client (and break it) but since the spec doesn't define
what to do in that case (guess it should just do nothing and let JAX-RS
handle it otherwise microprofile wouldn't be JAX-RS based anymore) and
defines that yaml is supposed to be the default then we are in a grey
enough area to make you happy ;). Worse case we would revert it but it is
not a prod usage for sure so no big deal for now.

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le ven. 4 janv. 2019 à 21:04, Ivan Junckes Filho <iv...@gmail.com> a
écrit :

> FYI I opened a PR on geronimo to fix the issue with text/html.
>
> https://github.com/apache/geronimo-openapi/pull/4
>
> Postman was working because it used */* and the implementation was
> properly handling it, but not handling text/html.
>
> On Thu, Jan 3, 2019 at 2:34 PM Ivan Junckes Filho <iv...@gmail.com>
> wrote:
>
>> Yes, the default content-type for browsers is text/html. I will submit a
>> pr accepting that.
>>
>> On Thu, Jan 3, 2019 at 2:17 PM César Hernández Mendoza <
>> cesarguate@gmail.com> wrote:
>>
>>> This  "default" behavior is also present in Metrics geronimo
>>> implementation.
>>> The issue is that the spec doesn't explicitly indicate the default
>>> content-type requirement.
>>>
>>> El jue., 3 ene. 2019 a las 9:48, Ivan Junckes Filho (<
>>> ivanjunckes@gmail.com>)
>>> escribió:
>>>
>>> > I will take a look and help troubleshoot this.
>>> >
>>> > On Thu, Jan 3, 2019 at 12:08 PM Puneeth PS <pu...@gmail.com>
>>> wrote:
>>> >
>>> > > Hi Ivan,
>>> > >
>>> > > /openapi works in POSTMAN client but not on browser, so might not be
>>> an
>>> > > issue.
>>> > >
>>> > > On Thu, Jan 3, 2019 at 6:38 PM Ivan Junckes Filho <
>>> ivanjunckes@gmail.com
>>> > >
>>> > > wrote:
>>> > >
>>> > > > Hi Puneeth, I added a couple of more comments.
>>> > > >
>>> > > > There seems to have a couple of bugs in the openapi implementation.
>>> > > >
>>> > > > Json serialization bug and also /openapi is not working without the
>>> > > header.
>>> > > > So we may need to open bugs
>>> > > > in https://issues.apache.org/jira/projects/GERONIMO/issues
>>> > > > <https://issues.apache.org/jira/projects/GERONIMO/issues>.
>>> > > >
>>> > > > I will try to help troubleshoot these issues.
>>> > > >
>>> > > >
>>> > > >
>>> > > >
>>> > > > On Thu, Jan 3, 2019 at 12:53 AM Puneeth PS <pu...@gmail.com>
>>> > wrote:
>>> > > >
>>> > > > > Hi Ivan,
>>> > > > >
>>> > > > > I have made the changes requested and I've some questions
>>> regarding
>>> > the
>>> > > > > spec which I've asked on the github thread, can you please
>>> clarify
>>> > > these?
>>> > > > >
>>> > > > > On Wed 2 Jan, 2019, 6:09 PM Ivan Junckes Filho <
>>> > ivanjunckes@gmail.com
>>> > > > > wrote:
>>> > > > >
>>> > > > > > Puneeth, I did some comments here
>>> > > > > >
>>> > https://github.com/apache/tomee/pull/340#pullrequestreview-188661807
>>> > > ,
>>> > > > > > please take a look.
>>> > > > > >
>>> > > > > > On Wed, Jan 2, 2019 at 9:51 AM Ivan Junckes Filho <
>>> > > > ivanjunckes@gmail.com
>>> > > > > >
>>> > > > > > wrote:
>>> > > > > >
>>> > > > > > > Hi Puneeth, I will review it for you.
>>> > > > > > >
>>> > > > > > > On Wed, Jan 2, 2019 at 8:39 AM Puneeth PS <
>>> puneeth.ps@gmail.com>
>>> > > > > wrote:
>>> > > > > > >
>>> > > > > > >> Hi,
>>> > > > > > >>
>>> > > > > > >> I have created a PR (
>>> https://github.com/apache/tomee/pull/340
>>> > )
>>> > > > for
>>> > > > > > >> TOMEE-2289. Can someone take a look and help me improve it?
>>> > > > > > >>
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>>
>>>
>>> --
>>> Atentamente:
>>> César Hernández Mendoza.
>>>
>>

Re: TOMEE-2289

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi Ivan

For the browser usage /openapi.json or /openapi.yaml will solve it nicely

On master we ensure to respect the request expected type - it is fine to
serialize it as html, this is even a way to implement a UI for it ;) - but
we also ensure there is a writer instead of assuming the user request will
work (new). This has the drawback to be able to send back an invalid
response to the client (and break it) but since the spec doesn't define
what to do in that case (guess it should just do nothing and let JAX-RS
handle it otherwise microprofile wouldn't be JAX-RS based anymore) and
defines that yaml is supposed to be the default then we are in a grey
enough area to make you happy ;). Worse case we would revert it but it is
not a prod usage for sure so no big deal for now.

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le ven. 4 janv. 2019 à 21:04, Ivan Junckes Filho <iv...@gmail.com> a
écrit :

> FYI I opened a PR on geronimo to fix the issue with text/html.
>
> https://github.com/apache/geronimo-openapi/pull/4
>
> Postman was working because it used */* and the implementation was
> properly handling it, but not handling text/html.
>
> On Thu, Jan 3, 2019 at 2:34 PM Ivan Junckes Filho <iv...@gmail.com>
> wrote:
>
>> Yes, the default content-type for browsers is text/html. I will submit a
>> pr accepting that.
>>
>> On Thu, Jan 3, 2019 at 2:17 PM César Hernández Mendoza <
>> cesarguate@gmail.com> wrote:
>>
>>> This  "default" behavior is also present in Metrics geronimo
>>> implementation.
>>> The issue is that the spec doesn't explicitly indicate the default
>>> content-type requirement.
>>>
>>> El jue., 3 ene. 2019 a las 9:48, Ivan Junckes Filho (<
>>> ivanjunckes@gmail.com>)
>>> escribió:
>>>
>>> > I will take a look and help troubleshoot this.
>>> >
>>> > On Thu, Jan 3, 2019 at 12:08 PM Puneeth PS <pu...@gmail.com>
>>> wrote:
>>> >
>>> > > Hi Ivan,
>>> > >
>>> > > /openapi works in POSTMAN client but not on browser, so might not be
>>> an
>>> > > issue.
>>> > >
>>> > > On Thu, Jan 3, 2019 at 6:38 PM Ivan Junckes Filho <
>>> ivanjunckes@gmail.com
>>> > >
>>> > > wrote:
>>> > >
>>> > > > Hi Puneeth, I added a couple of more comments.
>>> > > >
>>> > > > There seems to have a couple of bugs in the openapi implementation.
>>> > > >
>>> > > > Json serialization bug and also /openapi is not working without the
>>> > > header.
>>> > > > So we may need to open bugs
>>> > > > in https://issues.apache.org/jira/projects/GERONIMO/issues
>>> > > > <https://issues.apache.org/jira/projects/GERONIMO/issues>.
>>> > > >
>>> > > > I will try to help troubleshoot these issues.
>>> > > >
>>> > > >
>>> > > >
>>> > > >
>>> > > > On Thu, Jan 3, 2019 at 12:53 AM Puneeth PS <pu...@gmail.com>
>>> > wrote:
>>> > > >
>>> > > > > Hi Ivan,
>>> > > > >
>>> > > > > I have made the changes requested and I've some questions
>>> regarding
>>> > the
>>> > > > > spec which I've asked on the github thread, can you please
>>> clarify
>>> > > these?
>>> > > > >
>>> > > > > On Wed 2 Jan, 2019, 6:09 PM Ivan Junckes Filho <
>>> > ivanjunckes@gmail.com
>>> > > > > wrote:
>>> > > > >
>>> > > > > > Puneeth, I did some comments here
>>> > > > > >
>>> > https://github.com/apache/tomee/pull/340#pullrequestreview-188661807
>>> > > ,
>>> > > > > > please take a look.
>>> > > > > >
>>> > > > > > On Wed, Jan 2, 2019 at 9:51 AM Ivan Junckes Filho <
>>> > > > ivanjunckes@gmail.com
>>> > > > > >
>>> > > > > > wrote:
>>> > > > > >
>>> > > > > > > Hi Puneeth, I will review it for you.
>>> > > > > > >
>>> > > > > > > On Wed, Jan 2, 2019 at 8:39 AM Puneeth PS <
>>> puneeth.ps@gmail.com>
>>> > > > > wrote:
>>> > > > > > >
>>> > > > > > >> Hi,
>>> > > > > > >>
>>> > > > > > >> I have created a PR (
>>> https://github.com/apache/tomee/pull/340
>>> > )
>>> > > > for
>>> > > > > > >> TOMEE-2289. Can someone take a look and help me improve it?
>>> > > > > > >>
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>>
>>>
>>> --
>>> Atentamente:
>>> César Hernández Mendoza.
>>>
>>