-
Notifications
You must be signed in to change notification settings - Fork 0
OpenAPI spec: GroupAllocationRule 'name' field should be conditionally required #70
Copy link
Copy link
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation
Description
Summary
The DoiT API requires the name field in GroupAllocationRule when action is "create" or "update", but the OpenAPI specification marks name as optional.
Current Behavior
The OpenAPI spec defines GroupAllocationRule with name as optional:
GroupAllocationRule:
required:
- action
type: object
properties:
name:
type: string
description: Name for the allocation rule
action:
type: string
enum:
- create
- update
- selectHowever, the API returns a 400 error when name is missing for create or update actions:
{"error":"create action rule missing name"}Expected Behavior
The OpenAPI specification should reflect the actual API behavior. This could be documented via:
- Adding a description note explaining the conditional requirement
- Using
oneOfwith discriminator (if OpenAPI 3.1) - Marking
nameas required for all cases (simplest fix)
Workaround
A client-side validator (allocationRulesValidator) has been added to the Terraform provider to catch this at plan time rather than apply time. See commit 327d7ed.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation