[TT-17173] apidef classic schema: declare security_requirement_scopes#8253
Conversation
The APIDefinition struct emits security_requirement_scopes (json tag on []map[string][]string, paired by index with security_requirements to preserve per-scheme scope arrays from OAS root security:). The classic apidef JSON schema didn't declare the property, and the root carries additionalProperties: false, so every API definition carrying the field was rejected at validation with "Additional property security_requirement_scopes is not allowed". Declares the property as type [array, null] of objects whose additionalProperties is a [array, null] of strings, matching the Go field shape. TestSchema_SecurityRequirementScopes pins a populated DummyAPI() through Validate(Schema, …) so future struct/schema drift fails fast. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
🚨 Jira Linter FailedCommit: The Jira linter failed to validate your PR. Please check the error details below: 🔍 Click to view error detailsNext Steps
This comment will be automatically deleted once the linter passes. |
|
This PR updates the classic API definition JSON schema to declare the Files Changed Analysis
Architecture & Impact Assessment
Scope Discovery & Context ExpansionThe change is localized to the References
Metadata
Powered by Visor from Probelabs Last updated: 2026-05-27T12:19:05.999Z | Triggered by: pr_opened | Commit: b612be4 💡 TIP: You can chat with Visor using |
✅ Security Check PassedNo security issues found – changes LGTM. ✅ Architecture Check PassedNo architecture issues found – changes LGTM. ✅ Performance Check PassedNo performance issues found – changes LGTM. Powered by Visor from Probelabs Last updated: 2026-05-27T12:19:00.215Z | Triggered by: pr_opened | Commit: b612be4 💡 TIP: You can chat with Visor using |
|
Swagger Changes _ __ __
_| |_ _ / _|/ _| between swagger-prev.yml
/ _' | | | | |_| |_ and swagger-current.yml
\__,_|\__, |_| |_| returned no differences
| (_| | |_| | _| _| |
|



Summary
The
APIDefinitionstruct emitssecurity_requirement_scopes(json tag on[]map[string][]string, paired by index withsecurity_requirementsto preserve per-scheme scope arrays from OAS rootsecurity:). The classic apidef JSON schema didn't declare the property, and the root carriesadditionalProperties: false, so every API definition carrying the field was rejected by the dashboard'sPUT/POST /api/apisvalidator with:This blocks the TT-17173 dashboard companion PR —
TestAPIContext_OAS/update/oas_api/with_oas,…/with_old,…/with_old/bad_oasall fail post-merge for that reason.Change
apidef/schema.json— declaresecurity_requirement_scopesastype: [array, null]of objects whoseadditionalPropertiesis a[array, null]of strings (matches the Go field shape[]map[string][]string).apidef/api_definitions_test.go—TestSchema_SecurityRequirementScopespins a populatedDummyAPI()throughValidate(Schema, …), so future schema/struct drift fails fast.Story
Companion PRs
Test plan
go test ./apidef/...— clean across all 10 packagesTestSchema_SecurityRequirementScopesfails on pre-fix tree with the sameAdditional property … is not allowedmessage the dashboard CI surfaces, passes after the schema deltaRisk
Additive schema entry; no behaviour change for callers that don't populate the field. The
[array, null]typing andadditionalPropertiesshape mirror the neighbouringsecurity_requirementsblock.🤖 Generated with Claude Code
Ticket Details
TT-17173
Generated at: 2026-05-27 12:18:28