Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
6aeb534
Iniital docusaurus based site
jimschubert Dec 28, 2018
c81c9b4
Remove error about default local being used by String.format
jimschubert Dec 28, 2018
fb49fa7
Change pinned users to represent global presence rather than alphabet…
jimschubert Dec 29, 2018
37ce585
Include generator indexes in ensure-up-to-date (docusaurus site and /…
jimschubert Dec 29, 2018
c69af94
Add Font Awesome attribution footer
jimschubert Dec 29, 2018
c4de50f
Remove feature callout until it is completed
jimschubert Dec 29, 2018
193b096
Include NPM try it out section
jimschubert Dec 29, 2018
185313e
Improve "Getting Started" type docs
jimschubert Dec 30, 2018
78faa74
Include new custom template documentation
jimschubert Dec 30, 2018
e57f8f0
Updating templating and customization docs
jimschubert Dec 31, 2018
1978db5
Merge branch 'master' into docusaurus
jimschubert Dec 31, 2018
e335cfc
Add vendor extension docs
jimschubert Jan 3, 2019
d173d77
Cleanup templating page(s).
jimschubert Jan 4, 2019
1480418
Move users to yaml file for easy edit.
jimschubert Jan 4, 2019
009e2f3
travis configuration, and baseUrl mods to image URLs
jimschubert Jan 4, 2019
3ed68a0
[docs] Migrate FAQ, release summary from wiki
jimschubert Jan 7, 2019
cddb722
Copy current contributing/code of conduct to website
jimschubert Jan 7, 2019
9563e8e
[docs] Creating a new generator
jimschubert Jan 9, 2019
0750ef9
Merge branch 'master' into docusaurus
jimschubert Jan 9, 2019
7c15b42
Merge branch 'master' into docusaurus
wing328 Jan 18, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add vendor extension docs
  • Loading branch information
jimschubert committed Jan 3, 2019
commit e335cfcf115b79a20274531d6e4d51c681583fdf
106 changes: 106 additions & 0 deletions docs/generator-vendor-extensions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
---
id: generator-vendor-extensions
title: Vendor Extensions
---

This is a list of [vendor extensions](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#specification-extensions) used by different generators.

<!-- TODO: Auto-generate this list using generator metadata -->

The list may not be up-to-date, the best way is to look for "x-" in the mustache templates.

(All examples are in YAML format)

## ObjC
### x-objc-operationId

To customize the method name, you can provide a different name in x-objc-operationId, e.g.
```yaml
summary: Add a new pet to the store
description: ''
operationId: addPet
x-objc-operationId: CreateNewPet
```

## Java (Feign)
### x-accepts

A single `Accepts` value as the Feign API client needs a single value for `Accepts` header, e.g.
```yaml
consumes:
- application/json
- application/xml
x-accepts: application/json
```

### x-content-type

A single "Content-Type" value as the Feign API client needs a single value for `Content-Type` header, e.g.
```yaml
produces:
- application/xml
- application/json
x-content-type: application/json
```

## Rust-server

### x-responseId

Each response may specify a unique `x-responseId`. `rust-server` will use this to name the corresponding enum variant in the code. e.g.

```yaml
paths:
/ping:
get:
responses:
200:
description: OK
x-responseId: Pong
```

## 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.
1 change: 1 addition & 0 deletions website/sidebars.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
],
"Extending": [
"templating",
"generator-vendor-extensions",
"customization",
"integrations"
],
Expand Down