up
This commit is contained in:
36
src/Sdk/StellaOps.Sdk.Generator/postprocess/README.md
Normal file
36
src/Sdk/StellaOps.Sdk.Generator/postprocess/README.md
Normal file
@@ -0,0 +1,36 @@
|
||||
# Post-process Scaffold (SDKGEN-62-002)
|
||||
|
||||
These hooks are invoked via OpenAPI Generator's `--enable-post-process-file` option. They are deliberately minimal and deterministic:
|
||||
|
||||
- Normalise line endings to LF and strip trailing whitespace.
|
||||
- Preserve file mode 0644.
|
||||
- Inject a deterministic banner for supported languages (TS/JS/Go/Java/C#/Python/Ruby) when enabled (default on).
|
||||
- Language-specific rewrites (auth/retry/pagination/telemetry) will be added as SDKGEN-62-002 progresses.
|
||||
|
||||
## Usage
|
||||
|
||||
Set the generator's post-process command to this script (example for Bash):
|
||||
|
||||
```bash
|
||||
export STELLA_SDK_POSTPROCESS="$PWD/postprocess/postprocess.sh"
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Dorg.openapitools.codegen.utils.postProcessFile=$STELLA_SDK_POSTPROCESS"
|
||||
```
|
||||
|
||||
Or pass via CLI where supported:
|
||||
|
||||
```bash
|
||||
--global-property "postProcessFile=$PWD/postprocess/postprocess.sh"
|
||||
```
|
||||
|
||||
## Determinism
|
||||
- Uses only POSIX tools (`sed`, `perl`) available in build containers.
|
||||
- Does not reorder content; only whitespace/line-ending normalization.
|
||||
- Safe to run multiple times (idempotent).
|
||||
|
||||
## Configuration (optional)
|
||||
- `STELLA_POSTPROCESS_ADD_BANNER` (default `1`): when enabled, injects `Generated by StellaOps SDK generator — do not edit.` at the top of supported source files, idempotently.
|
||||
- Future flags (placeholders until implemented): `STELLA_POSTPROCESS_ENABLE_AUTH`, `STELLA_POSTPROCESS_ENABLE_RETRY`, `STELLA_POSTPROCESS_ENABLE_PAGINATION`, `STELLA_POSTPROCESS_ENABLE_TELEMETRY`.
|
||||
|
||||
## Next steps
|
||||
- Add language-specific post steps (auth helper injection, retry/pagination utilities, telemetry headers) behind flags per language template.
|
||||
- Wire into CI to enforce post-processed trees are clean.
|
||||
Reference in New Issue
Block a user