<?xml version="1.0" encoding="utf-8"?>
<?xml-model href="rfc7991bis.rnc"?>
<!-- <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?> --> 


<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>

<rfc
  xmlns:xi="http://www.w3.org/2001/XInclude"
  category="std"
  docName="draft-smith-api-catalog-00"
  ipr="trust200902"
  obsoletes=""
  updates=""
  submissionType="IETF"
  xml:lang="en"
  version="3">
<!-- 
    * docName should be the name of your draft
    * category should be one of std, bcp, info, exp, historic
    * ipr should be one of trust200902, noModificationTrust200902, noDerivativesTrust200902, pre5378Trust200902
    * updates can be an RFC number as NNNN
    * obsoletes can be an RFC number as NNNN 
-->

  <front>
    <title abbrev="Abbreviated Title">api-catalog: A well-known URI to help discovery of APIs</title>

    <seriesInfo name="Internet-Draft" value="draft-smith-api-catalog-00"/> 
   
    <author fullname="Kevin Smith" initials="K" role="editor" surname="Smith">
      
      <organization>Organization</organization>
      <address>
        <postal>
          <street>One Kingdom Street</street>
          <city>London</city>
           <code>W2 6BY</code>
          <country>GB</country>
        </postal>        
        <email>chwhbvqv@duck.com</email>  
        <uri>www.vodafone.com</uri>
      </address>
    </author>
   
    <date year="2023" month="" day=""/> <!-- https://authors.ietf.org/en/rfcxml-vocabulary#date -->
    <area>General</area>
    <workgroup>Internet Engineering Task Force</workgroup>
     <keyword>well-known</keyword>
	 <keyword>API</keyword>
     <abstract>
      <t>This document defines the "api-catalog" well-known URI. It is intended to facilitate discovery of the APIs published by a Web host.</t>
    </abstract> 
  </front>

  <middle>    
    <section>
    <!-- The default attributes for <section> are numbered="true" and toc="default" -->
	  <name>Introduction</name>
	  <t>A Web host may publish Application Programming Interfaces (APIs) to encourage requests for interaction from  external parties. Such APIs must be discovered before they may be used - i.e., the external party needs to know what APIs a given Web host exposes, including their purpose, any constraints to use, and the endpoints to interact with the APIs. To faciliate discovery of this information, this document proposes a well-known URI, 'api-catalog', as a location where a Web host's API endpoints are listed and described.</t>
	  
		<section anchor="goals">
			<name>Goals and non-goals</name>
			<t>The primary goal is to facilitate the discovery of both a Web Host's public API endpoints, and metadata that informs the potential API client of the purpose of each API and any constraints around usage.</t>
			
			<t>Non-goals: this document does not mandate paths for API endpoints. i.e., it is not mandating that my_example_api should be available at example.com/.well-known/api-catalog/my_example_api (although it is not forbidden to do so).</t>
		</section>
      
      <section anchor="requirements">
        <name>Requirements Language</name>
        <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL",
          "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT
          RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be
          interpreted as described in BCP 14 <xref target="RFC2119"/>
           when, and only when, they appear in
          all capitals, as shown here.</t>
      </section>
    </section>
    
    <section>
      <name>Using the 'api-catalog' well-known URI</name>
      <t>The api-catalog well-known URI is intended for HTTP(S) servers that publish APIs and wish to facilitate their discovery. The api-catalog URI SHALL follow the path-prefix for "well-known locations" defined in <xref target="RFC8615" />, namely /.well-known/ : i.e., example.com/.well-known/api-catalog </t>
	  <t>A Web host (example.com) supporting this URI SHALL resolve an HTTP(S) GET request to /.well-known/api-catalog with a list of public APIs. Web hosts SHOULD utilise existing formats to list their APIs, for example <xref target="apisJson" /> or <xref target="HAL"/>.</t>
    </section>

    <section anchor="IANA">
    <!-- All drafts are required to have an IANA considerations section. See RFC 8126 for a guide.-->
		<name>IANA Considerations</name>
		<t> This specification registers the "host-meta" well-known URI in the Well-Known URI Registry as defined by <xref target="RFC6415"/>.</t>
		<t>URI suffix: api-catalog</t>
		<t>Specification document(s):  draft-smith-api-catalog-00</t>
		<t>Related information:  The "api-catalog" documents obtained from the same host using the HTTP and HTTPS protocols (using default ports) MUST be identical.</t>
    </section>
    
    <section anchor="Security">
      <!-- All drafts are required to have a security considerations section. See RFC 3552 for a guide. -->
      <name>Security Considerations</name>
      <t>TBD</t>
    </section>
   </middle>

  <back>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8615.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6415.xml"/>	
      </references>

      <references>
        <name>Informative References</name>
          <reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119">
        <!-- Manually added reference -->
          <front>
            <title>Key words for use in RFCs to Indicate Requirement Levels</title>
            <author initials="S." surname="Bradner" fullname="S. Bradner">
              <organization/>
            </author>
            <date year="1997" month="March"/>
            <abstract>
              <t>In many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.
              </t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="2119"/>
          <seriesInfo name="DOI" value="10.17487/RFC2119"/>
        </reference>
       
        <reference anchor="HAL" target="https://datatracker.ietf.org/doc/html/draft-kelly-json-hal">
          <front>
            <title>JSON Hypertext Application Language</title>
            <author initials="M" surname="Kelly">
              <organization>stateless</organization>
            </author>
            <date year="2016"/>
          </front>
        </reference>

        <reference anchor="apisJson" target="https://github.com/apis-json/api-json">
          <front>
            <title>APIs.json: an API discovery definition format</title>
            <author>
              <organization>apis-json</organization>
            </author>
            <date year="2022"/>
          </front>
        </reference>       
       
      </references>
    </references>
    
    <section>
      <name>Appendix 1</name>
      <t>TODO, add examples in HAL and apisJson</t>
    </section>

    <section anchor="Acknowledgements" numbered="false">
      <!-- an Acknowledgements section is optional -->
      <name>Acknowledgements</name>
      <t>TODO</t>
    </section>
       
 </back>
</rfc>