You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -38,6 +39,166 @@ typed Go code for all possible OpenAPI Schemas. If there is a way to accomplish
38
39
something via utility code or reflection, it's probably a better approach than
39
40
code generation, which is fragile due to the very dynamic nature of OpenAPI and
40
41
the very static nature of Go.
42
+
```
43
+
44
+
## Install
45
+
46
+
It is recommended to follow [the `tools.go` pattern](https://www.jvt.me/posts/2022/06/15/go-tools-dependency-management/) for managing the dependency of `oapi-codegen` alongside your core application.
Alternatively, you can install it as a binary with:
64
+
65
+
```sh
66
+
$ go install github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen@latest
67
+
$ oapi-codegen -version
68
+
```
69
+
70
+
## Usage
71
+
72
+
`oapi-codegen` is largely **??**.
73
+
74
+
For full https://pkg.go.dev/github.com/deepmap/oapi-codegen/v2/pkg/codegen#Configuration
75
+
76
+
## Features
77
+
78
+
`oapi-codegen` supports:
79
+
80
+
- Generating server-side boilerplate for [a number of servers]
81
+
- Generating client API boilerplate
82
+
- Generating the types
83
+
- Splitting **??**
84
+
- Also described as ["external refs"] or "Import Mappings" in our documentation
85
+
86
+
## Key design decisions
87
+
88
+
- Bulk processing and parsing of OpenAPI document in Go
89
+
- Resulting output is using Go's `text/template`s, which are user-overridable
90
+
- Idiomatic Go
91
+
- Single-file output
92
+
- Support multiple OpenAPI files by having a package-per-file
93
+
-**??**
94
+
95
+
### Generating server-side boilerplate
96
+
97
+
`oapi-codegen` shines by making it fairly straightforward (note that this is a purposeful choice of wording here - we want to avoid words like "easy") to generate the server-side boilerplate for a backend API.
98
+
99
+
```
100
+
--------
101
+
```
102
+
103
+
Now you've generated this, you need to implement **??**.
104
+
105
+
```go
106
+
107
+
```
108
+
109
+
To provide you a fully Test Driven Development style test harness, you could use a tool such as **??** to **??**.
110
+
111
+
#### Supported Servers
112
+
113
+
<table>
114
+
115
+
<tr>
116
+
<th>
117
+
Server name
118
+
</th>
119
+
<th>
120
+
Configuration **??**
121
+
</th>
122
+
</tr>
123
+
124
+
<tr>
125
+
<td>
126
+
</td>
127
+
<td>
128
+
<code> </code>
129
+
</td>
130
+
</tr>
131
+
132
+
<tr>
133
+
<td>
134
+
</td>
135
+
<td>
136
+
<code> </code>
137
+
</td>
138
+
</tr>
139
+
140
+
<tr>
141
+
<td>
142
+
</td>
143
+
<td>
144
+
<code> </code>
145
+
</td>
146
+
</tr>
147
+
148
+
<tr>
149
+
<td>
150
+
</td>
151
+
<td>
152
+
<code> </code>
153
+
</td>
154
+
</tr>
155
+
156
+
</table>
157
+
158
+
### Generating API clients
159
+
160
+
### Generating API models
161
+
162
+
If you're looking to only generate the models for interacting with a remote service, for instance if you need to hand-roll the API client for whatever reason, you can do this as-is.
163
+
164
+
### Generating Nullable types
165
+
166
+
Opt-in, **??**
167
+
168
+
### OpenAPI extensions
169
+
170
+
As well as inbuilt OpenAPI, we also support the following OpenAPI extensions.
171
+
172
+
####
173
+
174
+
### Custom code generation
175
+
176
+
It is possible to extend **??** using the templates **??**.
177
+
178
+
Alternatively, you are able to use the underlying code generation as a package, which [will be documented in the future](https://github.com/deepmap/oapi-codegen/issues/1487).
179
+
180
+
## Examples
181
+
182
+
The [examples directory] contains some **??**, including how you'd take the Petstore API and **??**.
0 commit comments