Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Openapi Knowledge Patch?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/nevaberry-openapi-knowledge-patch)
---
name: openapi-knowledge-patch
description: OpenAPI
version: "3.2.1"
license: MIT
metadata:
author: Nevaberry
---
# OpenAPI Knowledge Patch
Load this skill when authoring or reviewing OpenAPI document structure,
operations, payloads, serialization, security schemes, server URLs, or
discriminator fallbacks. Use the references for detailed guidance and examples.
## Reference index
| Reference | Topics |
| --- | --- |
| [Document structure and operations](references/document-structure-and-operations.md) | Nested tags, HTTP methods, response metadata |
| [Payloads and serialization](references/payloads-and-serialization.md) | Form-style restrictions, XML nodes, parameters, headers, streams, multipart encodings, examples, reusable media types |
| [Security, servers, and validation](references/security-servers-and-validation.md) | Device authorization, security scheme metadata and requirements, server names and URL templates, discriminator fallbacks |
## Serialization restrictions and deprecations
### Form-style serialization
OpenAPI 3.2.1 prohibits these combinations for array or object values:
| Context | Prohibited combination |
| --- | --- |
| Cookie parameter (`in: cookie`) | `style: form` with `explode: false` |
| Encoding Object applying to the value | `style: form` with `explode: true` |
The Encoding Object restriction includes `application/x-www-form-urlencoded`
and `multipart/*` content.
### XML node mapping
Use `xml.nodeType` to map nodes to `element`, `attribute`, `text`, `cdata`,
or `none`.
- Use `attribute` in place of deprecated `attribute: true`.
- For arrays, use `element` in place of deprecated `wrapped: true`.
- The node type for arrays defaults to `none`.
```yaml
type: array
xml: {name: books, nodeType: element}
items: {type: string, xml: {name: book, nodeType: element}}
```
## Parameters, headers, and request methods
### Entire query strings
Use `in: querystring` with `content` to parse and validate the entire query
string as one value.
```yaml
parameters:
- name: filters
in: querystring
content:
application/x-www-form-urlencoded:
schema:
type: object
properties: {q: {type: string}}
```
### Header and cookie serialization
`allowReserved` is available on Header Objects and parameters at any location.
It affects serialization only where the location and style automatically
percent-encode values. Header serialization leaves values unencoded.
`style: cookie` separates cookie pairs with semicolons and leaves their data
values unencoded.
```yaml
parameters:
- name: preferences
in: cookie
style: cookie
explode: true
schema: {type: object}
```
### QUERY and other HTTP methods
Use the Path Item field `query` for HTTP QUERY operations, which can accept a
request body. Put methods without a dedicated Path Item field in
`additionalOperations`, using the actual method capitalization.
```yaml
paths:
/items:
query:
responses: {'200': {description: Matching items}}
additionalOperations:
LINK:
responses: {'204': {description: Linked}}
```
## Payload descriptions
### Sequential media types
Put `itemSchema` on a Media Type Object to describe each item in a stream such
as `text/event-stream`, `application/jsonl`, `application/json-seq`, or
`multipart/mixed`.
```yaml
content:
application/jsonl:
itemSchema: {type: object}
```
### Multipart part encodings
Multipart Media Type Objects can use `prefixEncoding` for leading parts and
`itemEncoding` for subsequent parts as an alternative to `encoding`.
```yaml
content:
multipart/mixed:
schema:
type: array
prefixItems: [{type: string}]
items: {type: object}
prefixEncoding: [{contentType: text/plain}]
itemEncoding: {contentType: application/json}
```
### Structured and serialized examples
In an Example Object, use `dataValue` for structured data and `serializedValue`
for its wire representation. An `externalValue` URL points to a serialized
example.
```yaml
examples:
result:
dataValue: {id: 42}
serializedValue: '{"id":42}'
```
### Reusable media types
Define common Media Type Objects under `components.mediaTypes`. Use a reference
such as `$ref: '#/components/mediaTypes/Result'` as the value of a media type key
in `content`.
## Security, servers, and schema selection
### Device authorization and security metadata
OAuth 2.0 Device Authorization uses `flows.deviceAuthorization` with
`deviceAuthorizationUrl` and `tokenUrl`. Security Scheme Objects also accept
`oauth2MetadataUrl` and `deprecated`.
A Security Requirement Object can use a scheme URI as its key.
### Server names and URL templates
Server Objects accept a `name`. Keep query strings and fragments out of `url`
and use each template variable once per URL.
### Discriminator fallbacks
`discriminator.defaultMapping` selects a fallback schema when the discriminator
property is missing or its value is unrecognized. The discriminator can also
omit `propertyName`.
## Document navigation and response metadata
### Nested tags
Tag Objects can name another tag in `parent` and provide a short `summary` for
display. The free-form `kind` field lets tools select tags by purpose, with
`nav` as the convention for navigation.
### Response metadata
A Response Object can use a short `summary` and omit `description`.
```yaml
responses:
'204': {summary: Deleted}
```