-
Notifications
You must be signed in to change notification settings - Fork 1
Vendor Extensions
Here is a list of vendor extensions used by different generators.
The list may not be up-to-date so the best way is to look for "x-" in the mustache templates.
(All examples are in YAML format)
To customize the method name, you can provide a different name in x-objc-operationId, e.g.
summary: Add a new pet to the store
description: ''
operationId: addPet
x-objc-operationId: CreateNewPet
A single Accepts
value as the Feign API client needs a single value for Accepts
header, e.g.
consumes:
- application/json
- application/xml
x-accepts: application/json
A single "Content-Type" value as the Feign API client needs a single value for Content-Type
header, e.g.
produces:
- application/xml
- application/json
x-content-type: application/json
Group parameters into a single object. x-group-parameters can be put at the top level of the spec or in each endpoint definition.
Group parameters into a single object. x-group-parameters can be put at the top level of the spec or in each endpoint definition.
Each response may specify a unique x-responseId
. rust-server
will use this to name the corresponding enum variant in the code. e.g.
paths:
/ping:
get:
responses:
200:
description: OK
x-responseId: Pong
MySQL schema generator creates vendor extensions based on openapi dataType
and dataFormat
. When user defined extensions with same key already exists codegen accepts those as is. It means it won't validate properties or correct it for you. Every model in definitions
can contain table related and column related extensions like in example below:
definitions:
Order:
description: This should be most common InnoDB table
type: object
properties:
id:
description: >-
This column should be unsigned BIGINT with AUTO_INCREMENT
type: integer
format: int64
x-mysqlSchema:
columnDefinition:
colName: id
colDataType: DECIMAL
colDataTypeArguments:
- argumentValue: 16
isString: false
hasMore: true
- argumentValue: 4
isString: false
hasMore: false
colUnsigned: true
colNotNull: true
colDefault:
defaultValue: AUTO_INCREMENT
isString: false
isNumeric: false
isKeyword: true
colComment: >-
Column comment. This column should be unsigned BIGINT with AUTO_INCREMENT
x-mysqlSchema:
tableDefinition:
tblName: orders
tblStorageEngine: InnoDB
tblComment: >-
Table comment. This should be most common InnoDB table
❗ There are properties that are not implemented by now(
tblStorageEngine
), but you can see how generator can be enhanced in future.