... | ... | @@ -50,4 +50,50 @@ paths: |
|
|
200:
|
|
|
description: OK
|
|
|
x-responseId: Pong
|
|
|
``` |
|
|
\ No newline at end of file |
|
|
```
|
|
|
|
|
|
### MySQL Schema
|
|
|
|
|
|
#### x-mysqlSchema
|
|
|
|
|
|
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:
|
|
|
|
|
|
```yaml
|
|
|
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
|
|
|
```
|
|
|
> :exclamation: There are properties that are not implemented by now(`tblStorageEngine`), but you can see how generator can be enhanced in future. |
|
|
\ No newline at end of file |