Skip to content

feat: add schema and data options for apis management commands - #1661

Merged
developerkunal merged 11 commits into
mainfrom
DXCDT-2107-agent-rollout-for-apis
Sep 17, 2026
Merged

developerkunal merged 11 commits into
mainfrom
DXCDT-2107-agent-rollout-for-apis

Conversation

@ramya18101

Copy link
Copy Markdown
Contributor

🔧 Changes

Adds --schema, --data, and --query flags to the auth0 apis management commands, making them usable by agents and automation tooling without interactive prompts.

auth0 apis list

  • --schema: prints the GET /resource-servers query-parameter schema and exits.
  • --query '{"name":"..."}': filters results by passing a JSON object directly to the API; any documented parameter works immediately.

auth0 apis create

  • --schema: prints the POST /resource-servers payload schema and exits.
  • --data <json|@file|stdin>: accepts a full JSON payload, validates it against the schema, and sends it — skipping all interactive prompts.

auth0 apis update

  • --schema: prints the PATCH /resource-servers/{id} payload schema and exits.
  • --data <json|@file|stdin>: same as create, applied as a partial update.

--data is mutually exclusive with individual field flags (--name, --identifier, etc.) on both create and update.

📚 References

🔬 Testing

Unit tests pass (make test-unit). Manual smoke tests:

# Schema discovery
auth0 apis list --schema
auth0 apis list --schema --json
auth0 apis create --schema
auth0 apis update --schema

# Query filtering
auth0 apis list --query '{"name":"My API"}' --json

# JSON input
auth0 apis create --data '{"name":"test-api","identifier":"https://test-api.example.com"}' --json
auth0 apis update <api-id> --data '{"token_lifetime":7200}' --json
echo '{"token_lifetime":3600}' | auth0 apis update <api-id> --json

# Mutual exclusion guard
auth0 apis create --data '{"name":"x"}' --name "y"  # must error

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

Base automatically changed from DXCDT-2107-agent-rollout-for-users to main September 17, 2026 06:35
@ramya18101
ramya18101 marked this pull request as ready for review September 17, 2026 06:35
@ramya18101
ramya18101 requested a review from a team as a code owner September 17, 2026 06:35
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.21053% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.02%. Comparing base (fdaa365) to head (66d6607).
⚠️ Report is 14 commits behind head on main.

Files with missing lines Patch % Lines
internal/cli/apis.go 84.21% 12 Missing and 6 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1661      +/-   ##
==========================================
+ Coverage   61.26%   62.02%   +0.75%     
==========================================
  Files         151      161      +10     
  Lines       30271    32530    +2259     
==========================================
+ Hits        18546    20176    +1630     
- Misses      10488    11004     +516     
- Partials     1237     1350     +113     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@developerkunal developerkunal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@developerkunal
developerkunal merged commit 6a9bb9c into main Sep 17, 2026
6 checks passed
@developerkunal
developerkunal deleted the DXCDT-2107-agent-rollout-for-apis branch September 17, 2026 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants