Skip to content

lemo-nade-room/swift-openapi-generator-pkl-types

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Swift OpenAPI Generator PKL Type Definitions

MIT License

日本語

This repository provides PKL-based type definitions for generating the openapi-generator-config.yaml file used by Apple’s swift-openapi-generator, ensuring type-safe configuration.

Requirements

  • macOS + Homebrew

    brew install pkl

* **PKL CLI**
  Documentation: [https://pkl-lang.org/main/current/pkl-cli/index.html](https://pkl-lang.org/main/current/pkl-cli/index.html)

## Type Definition File (`types.pkl`)

The `types.pkl` file includes definitions such as `SwiftOpenAPIGeneratorConfig`, `DocumentFilter`, and others.

* To leverage IDE (IntelliJ / VS Code) autocomplete and type checking, copy `types.pkl` into your project.
* Feel free to copy or modify its contents as needed.

## Defining Your Own Configuration

Create an `openapi-generator-config.pkl` that amends `types.pkl` and adds or overrides fields. For example:

```pkl
amends "./types.pkl"

generate {
  "client"
  "server"
}
namingStrategy = "idiomatic"
```

Add other supported keys—such as `additionalImports` or `filter`—as needed.

## Generating `openapi-generator-config.yaml`

```bash
pkl eval ./Sources/App/openapi-generator-config.pkl \
  > ./Sources/App/openapi-generator-config.yaml
```

About

Type-safe PKL definitions and examples for generating swift-openapi-generator’s config YAML.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages