From e09252fb460c893d137358c303a3b7a713c9dbe6 Mon Sep 17 00:00:00 2001 From: Kian-Meng Ang Date: Wed, 1 May 2024 00:34:01 +0800 Subject: [PATCH 1/2] Fix missing import statement in docs Make it easier to copy and paste the examples given in the docs. --- README.md | 8 ++++++-- guides/configuration.md | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2f26174..fb65178 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Hex.pm](https://img.shields.io/hexpm/v/oapi_generator)](https://hex.pm/packages/oapi_generator) [![Documentation](https://img.shields.io/badge/hex-docs-blue)](https://hexdocs.pm/oapi_generator) -[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md) +[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md) _A highly-configurable code generator that combines ergonomics with maintainability._ @@ -50,9 +50,13 @@ The real power of this library is in the available configuration. Although the options are conceptually simple, they add up to a better user experience. This project uses configuration profiles to allow multiple configurations with the same package. -To get started, create a profile called `default` in your configuration: +To get started, create a profile called `default` in your configuration file: ```elixir +# config/config.exs + +import Config + config :oapi_generator, default: [ output: [ base_module: Example, diff --git a/guides/configuration.md b/guides/configuration.md index ce8f4cb..28dab38 100644 --- a/guides/configuration.md +++ b/guides/configuration.md @@ -16,6 +16,8 @@ For example: ```elixir # config/config.exs +Import Config + config :oapi_generator, my_profile: [ output: [ @@ -287,7 +289,7 @@ Remember that all configuration values must be contained within a profile. This is an optional way to colocate generated operation 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.operation_use`: Module to include as a `use` statement at the top of every module containing operations. Defaults to no used module. See `OpenAPI.Renderer.Module.render_using/2` for more information. From ae6a61f771dea9435294f72e09de7730c633db55 Mon Sep 17 00:00:00 2001 From: AJ Foster <2789166+aj-foster@users.noreply.github.com> Date: Tue, 30 Apr 2024 20:40:52 -0400 Subject: [PATCH 2/2] Fix casing of import in configuration guide --- guides/configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/configuration.md b/guides/configuration.md index 28dab38..707d327 100644 --- a/guides/configuration.md +++ b/guides/configuration.md @@ -16,7 +16,7 @@ For example: ```elixir # config/config.exs -Import Config +import Config config :oapi_generator, my_profile: [