Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Advertising HTML-encoded AsyncAPI definition documents in PubSub enabled OGC API landing pages #534

Closed
ghobona opened this issue May 11, 2023 · 12 comments · Fixed by #539
Closed

Comments

@ghobona
Copy link
Contributor

ghobona commented May 11, 2023

This issue is related to opengeospatial/ogcapi-common#329 , however is more severe for HTML-encoded definition documents.

Consider the following fragment from the links in a landing page.

        {
            "rel": "service-doc",
            "type": "text/html",
            "title": "The OpenAPI definition as HTML",
            "href": "http://localhost:5000/openapi?f=html",
            "hreflang": "en-US"
        }

If a server wishes to advertise links to HTML-encoded AsyncAPI definition documents and HTML-encoded OpenAPI definition documents, there is a need to either provide a rel or type that allows such distinction to be made. Any thoughts on how this could be achieved?

Note that the reason why the issue is more severe for HTML-encoded definition documents, is because at least for JSON-encoded definition documents there is a specific media type for OpenAPI definition documents.

@ghobona
Copy link
Contributor Author

ghobona commented May 11, 2023

Cc: @tomkralidis @jerstlouis @cportele

@jerstlouis
Copy link
Member

jerstlouis commented Mar 14, 2024

It would not be possible to link to both an HTML rendering of an OpenAPI definition as well as an HTML rendering of the AsyncAPI if we rely on using the same service-doc link relation type.

For the service-desc, there is also a potential for conflict if not using a media-type specific to Async API (but using application/json) with any other API definition language that also does not have its own media type (not an issue with OpenAPI, which does have its own media type).

Is it too late to use something else than service-desc / service-doc?

Would it make sense to use something specific for describe async APIs ?

cc. @tomkralidis

@tomkralidis
Copy link
Collaborator

For the service-desc case, note that for service description the following open issue exists, however it looks like the issue has gone stale (aka a good time to bring back to life there!).

@ghobona
Copy link
Contributor Author

ghobona commented Mar 27, 2024

This issue has been moved from the OGC API - Common repo to the OGC API - EDR repo because that is where the PubSub extension is being developed.

@ghobona ghobona transferred this issue from opengeospatial/ogcapi-common Mar 27, 2024
@ghobona
Copy link
Contributor Author

ghobona commented Mar 27, 2024

This issue was discussed in the Joint OGC API SWGs session on 2024-03-27 session and a proposal to declare an OGC-specific relation type was approved.

@cportele
Copy link
Member

Apologies for not attending the Joint OGC API SWG session, but I do not see the argument for a different link relation type. service-doc applies both to a HTML documentation derived from an OpenAPI definition or an AsyncAPI definition. If there are two service-doc links, the human reader will understand their scope and that they describe two different APIs. And the title link attribute should clearly specify the meaning of the link target.

At least, if OGC defines a special AsyncAPI link relation type, it should not be mandatory to use it for links to the documentation of an event-driven API.

In any case, the type link attribute is only a hint.

@chris-little
Copy link
Contributor

chris-little commented Apr 11, 2024

EDR API 115 agreed not to change anything in the Part 2 spec but suggest a link with a media type suitable for all OGC APIs until the AsyncAPI community have an IANA registered link. @ghobona should be consulted. We suggest modelling on OpenAPI media type:

  • application/vnd.oai.openapi (YAML variant) -> application/vnd.aai.asyncapi
  • application/vnd.oai.openapi+json (JSON only variant) -> application/vnd.aai.asyncapi+json
  • application/vnd.oai.openapi;version=2.0 -> application/vnd.aai.asyncapi;version=2.0

@tomkralidis will propose this to the AsyncAPI community.

The IANA OpenAPI proposal probably will look like:

  • application/openapi+yaml;version=3.1
  • application/openapi+yaml;version=3.0;q=0.5
  • application/openapi+json;q=0.3

@tomkralidis
Copy link
Collaborator

ACTION: add note to 8.2.1 that AsyncAPI media type may change in the future.

@cportele
Copy link
Member

@tomkralidis

Since RFC 9512 has recently been published, it should be application/vnd.oai.asyncapi+yaml for the YAML variant, that is, with the suffix.

Also, I do not understand the use of oai. What does this refer to? Should this be aai for the "AsyncAPI Initiative"?

@tomkralidis
Copy link
Collaborator

tomkralidis commented Apr 11, 2024

@m-mohr
Copy link

m-mohr commented Apr 11, 2024

#539 still uses application/json, right? Is this planned to be updated?

@tomkralidis
Copy link
Collaborator

No, not until there is clarification from the AsyncAPI community. There is enough delineation for now of rel=service-desc between the OpenAPI media type and type=application/json (there is a possibility that rel=service-desc and type=application/json may get overloaded if one has multiple JSON-based service-desc endpoints, but IMHO that is an edge case atm).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants