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

Linking API to OpenAPI and documentation #724

Open
dret opened this issue Jul 4, 2016 · 22 comments
Open

Linking API to OpenAPI and documentation #724

dret opened this issue Jul 4, 2016 · 22 comments
Labels
discovery How to find OADs

Comments

@dret
Copy link
Contributor

dret commented Jul 4, 2016

would it make sense to recommend best practices for how an API should make its OpenAPI description (and potentially additional documentation) discoverable? we don't know how exactly an API is designed, but if it uses/supports hypermedia, we could recommend to use the link relations proposed here: https://tools.ietf.org/html/draft-wilde-service-link-rel
we might add text such as:

  • If an API wants to make its OAI description discoverable from the API itself, it is recommended to use the "service-desc" link relation.
  • If an API wants to make its external documentation discoverable from the API itself (the documentation that may be linked from the OpenAPI object via the "externalDocs" field), it is recommended to use the "service-doc" link relation.

i'd be more than happy to make a PR to that effect, but first wanted to raise an issue and discuss it.

@eskoviak
Copy link

eskoviak commented Jul 4, 2016

I think this would be an excellent feature. I have an use case in mind wherein having this sort of resource would be useful.

@darrelmiller
Copy link
Member

@dret We've discussed the use of described-by before to link an API to an OpenAPI description. Do you see service-desc as being more suited for this scenario?

@dret
Copy link
Contributor Author

dret commented Jul 4, 2016

On 2016-07-04 15:58, Darrel wrote:

@dret https://github.com/dret We've discussed the use of described-by
before to link an API to an OpenAPI description. Do you see service-desc
as being more suited for this scenario?

i am certainly biased because i have cooked up the "service-desc" and
"service-doc" link relation types myself for exactly this kind of scenario.

"described-by" seems a bit odd to me in this case because it seems to be
used mostly for cases where the "described-by" resource is metadata
about the linking resource, such as who authored it, when, and these
kinds of things. but the specification itself is so broad that with
enough willingness, "described-by" is almost the only link relation you'll
ever need on the web:

"The relationship A describedby B asserts that resource B provides a
description of resource A. There are no constraints on the format or
representation of either A or B, neither are there any further
constraints on either resource."

in the end, all the link relation types have fuzzy definitions that
invite a variety of interpretations. but i don't think "described-by"
would be a great fit, because that might better be used to link to a
resource with specific metadata about the linking resource.

@dret
Copy link
Contributor Author

dret commented Jul 4, 2016

On 2016-07-04 13:03, Ed Skoviak wrote:

I think this would be an excellent feature. I have an use case in mind
wherein having this sort of resource would be useful.

strictly speaking this would just be a best practice and not an actual
feature that the spec could or should define. but it could be something
to make this aspect of connectedness of resources on the web a bit
better than it is today.

@ePaul
Copy link
Contributor

ePaul commented Jul 4, 2016

@darrelmiller I agree with @dret here – describedby seems to be more about a description of the resource content, not of the API (i.e. the resource format/syntax/...).

@dret
Copy link
Contributor Author

dret commented Jul 5, 2016

only positive feedback so far. i take that as a form on encouragement. ;-)

@wparad
Copy link

wparad commented Jul 5, 2016

So, I think this is a weird request. Something like, because of the use of hypermedia, you would never need to know what all the API's look like, just the ones which are related to the current resource. I like there was an earlier issue requesting the OPTIONS method for the base url to return the document, that seemed like the best idea, it really only needs to be in a place where a person can get it. It would probably end up problematic for this sort of thing to turn into the wsdl.

@dret
Copy link
Contributor Author

dret commented Jul 5, 2016

On 2016-07-05 18:34, Warren Parad wrote:

So, I think this is a weird request. Something like, |because of the use
of hypermedia, you would never need to know what all the API's look
like, just the ones which are related to the current resource|.

could you elaborate a bit? i don't think i quite get what you're saying
and what you find weird about the issue. the issue is about how to link
to an OpenAPI description, in case you want to do this. if you don't
want to do this, then that's fine as well.

I like
there was an earlier issue requesting the |OPTIONS| method for the base
url to return the document, that seemed like the best idea, it really
only needs to be in a place where a person can get it. It would probably
end up problematic for this sort of thing to turn into the wsdl.

again, please elaborate on that a little bit. what's the connection
between interlinking resources and WSDL?

@wparad
Copy link

wparad commented Jul 5, 2016

@dret, you bring up some interesting points. Most noteworthy I would add though is fundamentally hypermedia provides the mechanism for self-discoverable APIs. I have found Google's similar thing with instructions, but I tempted to believe that this documention should be available from a human readable source, a wiki, developer docs, etc... What would be the use case to have something like this?

@dret
Copy link
Contributor Author

dret commented Jul 5, 2016

On 2016-07-05 20:10, Warren Parad wrote:

@dret https://github.com/dret, you bring up some interesting points.
Most noteworthy I would add though is fundamentally hypermedia provides
the mechanism for self-discoverable APIs. I have found Google's similar
thing https://www.googleapis.com/discovery/v1/apis with instructions
https://developers.google.com/discovery/v1/reference/apis, but I
tempted to believe that this documention should be available from a
human readable source, a wiki, developer docs, etc... What would be the
use case to have something like this?

to have something like what? do you mean the links that i propose in
that issue? it makes the service description and service documentation
discoverable from a resource via standardized/recommended means.

i am afraid i still don't quite understand your concerns. are you
concerned about making description/documentation discoverable as
proposed in this issue, or concerned about the specifics how it is proposed?

@wparad
Copy link

wparad commented Jul 6, 2016

Aren't full APIs discoverable from their documentation, I.e. your service wiki or client homepage/portal. Is that not what service owners are doing? Are some teams doing something that makes no sense?

@dret
Copy link
Contributor Author

dret commented Jul 6, 2016

On Jul 6, 2016, at 20:25, Warren Parad [email protected] wrote:

Aren't full APIs discoverable from their documentation, I.e. your service wiki or client homepage/portal. Is that not what service owners are doing? Are some teams doing something that makes no sense?

i don't know the answer to that question. but i don't think it matters for this issue. this issue is about how to discover service description/documentation from resources, not the other way around.

@wparad
Copy link

wparad commented Jul 7, 2016 via email

@darrelmiller
Copy link
Member

@wparad What @dret is suggesting is to use link relations. That what service-desc and service-doc are. The important part is that they bring meaningful semantics to an embeded URL. Obviously, you can chose not to use them, but I see value in OpenAPI making a recommendation regarding the appropriate link relation type identifier that can be used to discover the spec. It's definitely better than our current reliance on a well known filename.

@dret
Copy link
Contributor Author

dret commented Jul 7, 2016

On 2016-07-07 21:04, Warren Parad wrote:

Isn't the recommendation is always use link relations where appropriate?
Especially type and self, others as it makes sense. I'm not sure how
useful the ones in the rfc you created are, although I suppose someone
could find a use, but either way, why call them out in the Open API
specification?

the proposal of this issue is to recommend to make OpenAPI descriptions
discoverable. the issue proposes to do that using specific link relation
types. do you object against making Open API descriptions discoverable,
or against using the proposed link relation types?

dret added a commit to dret/swagger-spec that referenced this issue Jul 12, 2016
@dret
Copy link
Contributor Author

dret commented Jul 12, 2016

first stab at #734, any feedback greatly appreciated. thanks!

@dret
Copy link
Contributor Author

dret commented Oct 7, 2016

is there anything i can do to help moving this issue forward? thanks!

@MikeRalphson
Copy link
Member

See also the schema.org WebAPI type, where the documentation property can point to an OpenAPI definition.

@dret
Copy link
Contributor Author

dret commented May 29, 2017

just wondering: this does not seem to have made it into 3.0. is there anything i can do to help? it would be great to see that there is a recommended way of linking an API to its OpenAPI spec.

@webron
Copy link
Member

webron commented May 31, 2017

@dret I'm afraid not. We're feature complete for 3.0 and try mostly to deal with fixes. We have marked your PR as post 3.0 for future consideration.

@dret
Copy link
Contributor Author

dret commented Jun 1, 2017 via email

@dret
Copy link
Contributor Author

dret commented Apr 1, 2022

Does it make sense to revive this issue for maybe add discoverability guidance to whatever the next OpenAPI version is?

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

No branches or pull requests

8 participants