OpenAPI Specification Path: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 18: Line 18:
     [[#Operations|patch]]: [...]
     [[#Operations|patch]]: [...]
     [[#Operations|trace]]: [...]
     [[#Operations|trace]]: [...]
    [[#Parameters|parameters]]: [...]
     servers:
     servers:
    parameters:
   /b:
   /b:
     [...]
     [...]
Line 27: Line 27:
</font>
</font>


</font>
=Path=
Each '''path name''' must start with a forward slash "/". The path is appended to the expanded URL from the server object <code>url</code> field in order to construct the full URL. [[#Path_Templating|Path templating]] is allowed. Each path accepts zero or more of the available [[#Operations|operations]] (<code>get</code>, <code>put</code>, <code>post</code>, <code>delete</code>, <code>options</code>, <code>head</code>, <code>patch</code>, <code>trace</code>) and <code>[[#Parameters|parameters]]</code>, which is a list of parameters that are applicable for all the operations described under this path. These parameters can be overridden at operation level but cannot be removed there.
=Path Templating=
{{External|https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#pathTemplating}}
Path templating refers to the usage of curly braces <code>{}</code> to mark a section of a URL path as replaceable using [[#Path_Parameters|path parameters]].
=Operations=
=Parameters=
A unique parameter is defined by a combination of a name and a location.

Revision as of 17:30, 26 January 2024

Internal

Overview

The top level paths keyword introduce a map of paths, keyed by their path value:

[...]
paths:
 /a:
    summary:
    description: 
    get: [...]
    put: [...]
    post: [...]
    delete: [...]
    options: [...]
    head: [...]
    patch: [...]
    trace: [...]
    parameters: [...]
    servers:
 /b:
   [...]
 /c:
   [...]
[...]

Path

Each path name must start with a forward slash "/". The path is appended to the expanded URL from the server object url field in order to construct the full URL. Path templating is allowed. Each path accepts zero or more of the available operations (get, put, post, delete, options, head, patch, trace) and parameters, which is a list of parameters that are applicable for all the operations described under this path. These parameters can be overridden at operation level but cannot be removed there.

Path Templating

https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#pathTemplating

Path templating refers to the usage of curly braces {} to mark a section of a URL path as replaceable using path parameters.

Operations

Parameters

A unique parameter is defined by a combination of a name and a location.