Skip to content

Commit 9ce866a

Browse files
committed
Add docs
1 parent 7ad1e8b commit 9ce866a

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

docs/customization.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,28 @@ Into this securityScheme:
724724
type: http
725725
```
726726

727+
- `SECURITY_SCHEMES_FILTER`
728+
729+
The `SECURITY_SCHEMES_FILTER` parameter allows selective inclusion of API security schemes based on specific criteria. It applies the `x-internal: true` property to operations that do **not** match the specified values, preventing them from being generated. Multiple filters can be separated by a semicolon.
730+
731+
### Available Filters
732+
733+
- **`key`**
734+
When set to `key:api_key|http_bearer`, security schemes **not** matching `api_key` or `http_bearer` will be marked as internal (`x-internal: true`), and excluded from generation. Matching operations will have `x-internal: false`.
735+
736+
- **`type`**
737+
When set to `type:apiKey|http`, security schemes **not** using `apiKey` or `http` types will be marked as internal (`x-internal: true`), preventing their generation.
738+
739+
### Example Usage
740+
741+
```sh
742+
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate \
743+
-g java \
744+
-i modules/openapi-generator/src/test/resources/3_0/petstore.yaml \
745+
-o /tmp/java-okhttp/ \
746+
--openapi-normalizer SECURITY_SCHEMES_FILTER="key:api_key|http_bearer ; type:oauth2"
747+
```
748+
727749
- `SORT_MODEL_PROPERTIES`: When set to true, model properties will be sorted alphabetically by name. This ensures deterministic code generation output regardless of property ordering in the source spec.
728750

729751
Example:

0 commit comments

Comments
 (0)