From 325ac3deb21ba0d612bead0e8b2a1c93579d70c5 Mon Sep 17 00:00:00 2001 From: AJ Foster <2789166+aj-foster@users.noreply.github.com> Date: Wed, 6 Sep 2023 01:44:09 -0400 Subject: [PATCH] Release 0.1.0-rc.0 --- CHANGELOG.md | 9 ++++++++ README.md | 2 +- guides/configuration.md | 8 +++++-- guides/migration.md | 51 +++++++++++++++++++++++++++++++++++++++++ mix.exs | 2 +- 5 files changed, 68 insertions(+), 4 deletions(-) create mode 100644 guides/migration.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d3bf5a..4dff93f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## 0.1.0-rc.0 + +**Breaking**: This is a major release. + See the [migration guide](guides/migration.md) for more information. +**Add**: Plugin system for overriding the behavior of this library. + See the [plugins guide](guides/plugins.md) for more information. +**Add**: Additional internal types to represent string variations, enums, etc. +**Fix**: Uniformly normalize names of operations and schemas. + ### 0.0.7 (2023-06-07) **Add**: `schema_use` option to add optional `use [Module]` statements within schemas. diff --git a/README.md b/README.md index eb05899..535da0a 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ Add the dependency in `mix.exs`: ```elixir def deps do [ - {:oapi_generator, "~> 0.0.7"} + {:oapi_generator, "0.1.0-rc.0"} ] end ``` diff --git a/guides/configuration.md b/guides/configuration.md index b164bda..c47ae82 100644 --- a/guides/configuration.md +++ b/guides/configuration.md @@ -250,6 +250,10 @@ Remember that all configuration values must be contained within a profile. Defaults to an empty list of merges. See `OpenAPI.Processor.Naming.merge_schema/2` for more information. +* `naming.operation_use_tags`: Whether to use tags when determining module names for operations. + Defaults to `true`. + See `OpenAPI.Processor.Naming.operation_modules/2` for more information. + * `naming.rename`: List of tuples containing patterns and replacements to use when renaming modules. Defaults to an empty list of replacements. See `OpenAPI.Processor.Naming.rename_schema/2` for more information. @@ -283,12 +287,12 @@ Remember that all configuration values must be contained within a profile. Defaults to no used module. See `OpenAPI.Renderer.Module.render_using/2` for more information. -* `output_schema_subdirectory`: Subdirectory to use for all rendered files containing only schemas. +* `output.schema_subdirectory`: Subdirectory to use for all rendered files containing only schemas. This is an optional way to colocate generated schema modules in a single directory away from other parts of the client library. Defaults to the same location as `output.location`. See `OpenAPI.Renderer.Module.filename/2` for more information. -* `output_schema_use`: Module to include as a `use` statement at the top of every module containing only schemas. +* `output.schema_use`: Module to include as a `use` statement at the top of every module containing only schemas. Defaults to no used module. See `OpenAPI.Renderer.Module.render_using/2` for more information. diff --git a/guides/migration.md b/guides/migration.md new file mode 100644 index 0000000..052fa34 --- /dev/null +++ b/guides/migration.md @@ -0,0 +1,51 @@ +# Migration Guide + +This document assists in the migration across breaking changes of the library. + +## 0.0.x to 0.1.0 + +This version change represents a major rewrite of the core logic of the library. +There are many new features, such as the ability to override the default implementation of most parts of the processing and rendering of the code. +To facilitate this, much of the configuration has moved. + +### Move Configuration + +Within a configuration profile, make the following changes to configuration keys: + +* `base_location` -> `output.location` +* `base_module` -> `output.base_module` +* `default_client` -> `output.default_client` +* `extra_fields` -> `output.extra_fields` +* `group` -> `naming.group` +* `merge` -> `naming.merge` +* `operation_default_module` -> `naming.default_operation_module` +* `operation_location` -> `output.operation_subdirectory` +* `operation_use_tags` -> `naming.operation_use_tags` +* `rename` -> `naming.rename` +* `schema_location` -> `output.schema_subdirectory` +* `schema_use` -> `output.schema_use` +* `types` -> `output.types` + +For example, if your configuration previously had the following: + +```elixir +config :oapi_generator, default: [ + base_module: MyClient +] +``` + +Now, you should have: + +```elixir +config :oapi_generator, default: [ + output: [ + base_module: MyClient + ] +] +``` + +### Adopt New Types + +There are new (and modified) internal representations of types returned from `field/1` schema functions. +If you use this information in a typed decoder, for example, it is necessary to adopt the new types. +See `OpenAPI.Processor.Type` for more information. diff --git a/mix.exs b/mix.exs index 0cb3206..ea4b4cc 100644 --- a/mix.exs +++ b/mix.exs @@ -1,7 +1,7 @@ defmodule OpenAPI.MixProject do use Mix.Project - @version "0.0.7" + @version "0.1.0-rc.0" @source_url "https://github.com/aj-foster/open-api-generator" def project do