#2
feat: discriminated union support in openapi.yml through flags
Adds discriminated union support and array/object body flags
generateBodyFlags() returned [] for schemas using oneOf/allOf/anyOf, making endpoints with discriminated unions unusable without --data. array and typeless object properties were silently skipped.
This PR change flattens composition keywords into merged property sets before flag generation, and adds array/json flag types so fields like labels: array and config: object produce usable CLI flags.
Before, an endpoint with a oneOf request body showed no flags at all:
myapi prompts create --help
# Only showed: --curl, --json, --server, --bearer-token, -h
# No body flags — users had to use raw JSON:
myapi prompts create --data '{"name":"greet","type":"text","prompt":"hello","labels":["prod"]}'
# Now individual flags are generated from the merged union branches:
myapi prompts create --help
# Shows: --name, --type, --prompt, --labels, --config, ...
myapi prompts create --name greet --type text --prompt hello --labels prod,staging --config '{"temperature":0.7}'currently, we have to patch our OpenAPI.yml file to flatten it before we use specli which is a bit annoying :). Hope the PR works / open to feedback etc !
Thank you for providing this software!