Skip to content

Commit 9ff7343

Browse files
author
Jamie Tanna
committed
sq
1 parent f49f077 commit 9ff7343

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

README.md

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# `oapi-codegen`
22

3-
`oapi-codegen` is a command-line tool and library, to convert OpenAPI API specifications to Go code, be it server-side implementations, API clients, or simply HTTP models.
3+
`oapi-codegen` is a command-line tool and library to convert OpenAPI specifications to Go code, be it server-side implementations, API clients, or simply HTTP models.
44

55
`oapi-codegen` aims to reduce some of the tedious boilerplate that can be found when building or interacting with APIs, and focusses on:
66

@@ -50,18 +50,18 @@ Which then means you can invoke it like so:
5050

5151
## Usage
5252

53-
`oapi-codegen` is largely configured using a YAML configuration file, to simplify the number of flags that users need to remember.
53+
`oapi-codegen` is largely configured using a YAML configuration file, to simplify the number of flags that users need to remember, and to tune various **??**.
5454

55-
For full https://pkg.go.dev/github.com/deepmap/oapi-codegen/v2/pkg/codegen#Configuration
55+
For full details of what is supported, it's worth checking out [the GoDoc for `codegen.Configuration`](https://pkg.go.dev/github.com/deepmap/oapi-codegen/v2/pkg/codegen#Configuration).
5656

5757
## Features
5858

5959
`oapi-codegen` supports:
6060

61-
- Generating server-side boilerplate for [a number of servers] TODO
62-
- Generating client API boilerplate
63-
- Generating the types
64-
- Splitting **??**
61+
- Generating server-side boilerplate for [a number of servers] TODO ([docs](#generating-server-side-boilerplate))
62+
- Generating client API boilerplate ([docs](#generating-api-clients))
63+
- Generating the types ([docs](#generating-api-models))
64+
- Splitting **??** ([docs](#import-mapping))
6565
- Also described as ["external refs"] or "Import Mappings" in our documentation
6666

6767
## Key design decisions
@@ -458,7 +458,7 @@ This **??**
458458
--------------------- TODO ---------
459459
```
460460

461-
oapi-codegen also supports generating RPC inspired strict server, that will parse request bodies and encode responses.
461+
`oapi-codegen` also supports generating RPC inspired strict server, that will parse request bodies and encode responses.
462462
The main points of this code is to automate some parsing, abstract user code from server specific code,
463463
and also to force user code to comply with the schema.
464464
It supports binding of `application/json` and `application/x-www-form-urlencoded` to a struct, for `multipart` requests
@@ -795,6 +795,13 @@ output-options:
795795
796796
For a complete example see [`examples/petstore-expanded/only-models`](examples/petstore-expanded/only-models).
797797

798+
### Splitting large OpenAPI specs across multiple packages (aka "Import Mapping" or "external references")
799+
<a name=import-mapping></a>
800+
801+
```
802+
TODO
803+
```
804+
798805
### Generating Nullable types
799806
800807
It's possible that you want to be able to determine whether a field isn't sent, is sent as `null` or has a value.
@@ -811,7 +818,7 @@ S:
811818
required: []
812819
```
813820

814-
The default behaviour in oapi-codegen is to generate:
821+
The default behaviour in `oapi-codegen` is to generate:
815822

816823
```go
817824
type S struct {
@@ -887,8 +894,6 @@ For simplicity, and to remove a fair bit of duplication and boilerplate, `oapi-c
887894
888895
Below you can see some examples of how `additionalProperties` affects the generated code.
889896

890-
There are many special cases for `additionalProperties`, such as having to define types for inner fields which themselves support `additionalProperties`, and all of them are tested via the [`internal/test/components`](internal/test/components) schemas and tests. Please look through those tests for more usage examples.
891-
892897
#### Implicit `additionalProperties: true` / no `additionalProperties` set
893898

894899
```yaml

0 commit comments

Comments
 (0)