diff --git a/CHANGELOG.md b/CHANGELOG.md index f5f0a26..463f1c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,8 +7,32 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [unreleased] +## [0.7.0] - 2024-09-23 + ### Added -- Add documentation for generated types. [Leonardo Taglialegne](https://github.com/miniBill) + +- Documentation for generated types. [Leonardo Taglialegne](https://github.com/miniBill) +- A new record type for generated endpoints. [Leonardo Taglialegne](https://github.com/miniBill) + - This allows for incorporating with your own custom HTTP approach. +- Support for multiple servers as a CLI argument. [Leonardo Taglialegne](https://github.com/miniBill) +- Support for overriding portions of an OAS with the `--overrides` CLI argument. [Leonardo Taglialegne](https://github.com/miniBill) + - Support for writing the overridden OAS to a file. [Leonardo Taglialegne](https://github.com/miniBill) +- Support for `date` and `date-time` types. [Leonardo Taglialegne](https://github.com/miniBill) + - If your OAS has these types, you'll need these additional dependencies: + - [wolfadex/elm-rfc3339](https://package.elm-lang.org/packages/wolfadex/elm-rfc3339/latest) + - This is the core new requirement as JSON Schema `date` and `date-time` are in [RFC-3339](https://json-schema.org/understanding-json-schema/reference/string#dates-and-times) format + - [justinmimbs/time-extra](https://package.elm-lang.org/packages/justinmimbs/time-extra/latest) + - [justinmimbs/date](https://package.elm-lang.org/packages/justinmimbs/date/latest) + - [elm/time](https://package.elm-lang.org/packages/elm/time/latest) + - [elm/parser](https://package.elm-lang.org/packages/elm/parser/latest) + +### Changed + +- General documentation cleanup. [Leonardo Taglialegne](https://github.com/miniBill) +- Improved handling of bytes. [Leonardo Taglialegne](https://github.com/miniBill) +- When there's a single error, don't define a custom type for it. [Leonardo Taglialegne](https://github.com/miniBill) +- Enums are now custom types not `String`s. [Leonardo Taglialegne](https://github.com/miniBill) +- Improved errors for Swagger files. [Leonardo Taglialegne](https://github.com/miniBill) ## [0.6.1] - 2024-07-23 @@ -16,7 +40,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Decoding a `String` as a `String` and not as JSON. ✨ [Leonardo Taglialegne](https://github.com/miniBill) - ## [0.6.0] - 2024-07-16 ### Added diff --git a/docs/USAGE.md b/docs/USAGE.md index 0038d9e..30147a6 100644 --- a/docs/USAGE.md +++ b/docs/USAGE.md @@ -2,24 +2,26 @@ ### Install the CLI: -- `npm install -D elm-open-api` +- `npm install -D elm-open-api` ### Run the CLI: -- `npx elm-open-api ./page/to/oas.json` +- `npx elm-open-api ./page/to/oas.json` ### Arguments you can pass: -- ``: The path to the Open API Spec, either `.json` or `.y[a]ml` - - Technically the OAS allows for parts of a spec to be in separate files, but this isn't supported yet. -- `[--output-dir ]`: The directory to output to. Defaults to `generated/`. -- `[--module-name ]`: The Elm module name. Default to ``. -- `[--auto-convert-swagger]`: If passed in, and a Swagger doc is encountered, will attempt to convert it to an Open API file. If not passed in, and a Swagger doc is encountered, the user will be manually prompted to convert. -- `[--swagger-conversion-url]`: The URL to use to convert a Swagger doc to an Open API file. Defaults to `https://converter.swagger.io/api/convert`. -- `[--swagger-conversion-command]`: Instead of making an HTTP request to convert from Swagger to Open API, use this command. -- `[--swagger-conversion-command-args]`: Additional arguments to pass to the Swagger conversion command, before the contents of the Swagger file are passed in. -- `[--generateTodos ]`: Whether to generate TODOs for unimplemented endpoints, or fail when something unexpected is encountered. Defaults to `no`. To generate `Debug.todo ""` instead of failing use one of: `yes`, `y`, `true`. - +- ``: The path to the Open API Spec, either `.json` or `.y[a]ml` + - Technically the OAS allows for parts of a spec to be in separate files, but this isn't supported yet. +- `[--output-dir ]`: The directory to output to. Defaults to `generated/`. +- `[--module-name ]`: The Elm module name. Default to ``. +- `[--auto-convert-swagger]`: If passed in, and a Swagger doc is encountered, will attempt to convert it to an Open API file. If not passed in, and a Swagger doc is encountered, the user will be manually prompted to convert. +- `[--swagger-conversion-url]`: The URL to use to convert a Swagger doc to an Open API file. Defaults to `https://converter.swagger.io/api/convert`. +- `[--swagger-conversion-command]`: Instead of making an HTTP request to convert from Swagger to Open API, use this command. +- `[--swagger-conversion-command-args]`: Additional arguments to pass to the Swagger conversion command, before the contents of the Swagger file are passed in. +- `[--generateTodos ]`: Whether to generate TODOs for unimplemented endpoints, or fail when something unexpected is encountered. Defaults to `no`. To generate `Debug.todo ""` instead of failing use one of: `yes`, `y`, `true`. +- `[--overrides ]`: Load an additional file to override parts of the original Open API file. + - This is most commonly used for malformed OAS files (e.g. missing `required` on a required field) but can be used for anything you want +- `[--write-merged-to ]`: Write the merged Open API spec to the given file (see `--overrides` for merging). ## Example outputs: Assume we have an OAS file named `my-cool-company-oas.json` and it has a field `"title": "My Coool Company"` and we run the CLI like so diff --git a/package.json b/package.json index e06452c..50712e8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "elm-open-api", - "version": "0.6.1", + "version": "0.7.0", "description": "A tool for generating Elm SDKs from OpenAPI Specs.", "main": "dist/elm-open-api.js", "bin": "dist/elm-open-api.js",