Frequently Asked Questions#
Common questions about APX usage, configuration, and best practices.
Architecture & Design#
Q: Will v2 code leak into v1 consumers?#
A: No. v2 lives in a separate Go module (.../v2 with its own go.mod). v1 imports never see v2 unless explicitly referenced. This follows Go’s semantic import versioning.
Q: Can APX discover APIs across the organization?#
A: Yes. apx search <keywords> queries the catalog (generated in the canonical repo). You can also browse available tags and versions with apx list apis.
Q: Can APX update dependencies automatically?#
A: Yes. apx update <api> gets the latest patch/minor within the current major version. apx upgrade <api>@<version> targets a specific major version upgrade.
Q: How does APX publish APIs?#
A: APX uses git subtree to publish APIs, preserving complete commit history, authorship, and context in the canonical repository.
Governance & Policy#
Q: How do we handle breaking changes?#
A: APX detects breaking changes automatically using format-specific tools (buf, oasdiff, etc.). Breaking changes require major version bumps. apx version suggest will recommend the appropriate version based on detected changes.
Versioning & Compatibility#
Q: What’s the difference between directory versions (v1/) and module versions?#
A:
Directory structure:
proto/payments/ledger/v1/contains schema filesProto package:
myorg.payments.ledger.v1includes version suffixGo module path:
github.com/org/apis/proto/payments/ledger(v1 has no suffix)Module path v2+:
github.com/org/apis/proto/payments/ledger/v2(includes suffix)
Q: How do we handle schema evolution within a major version?#
A: Within a major version (e.g., v1), you can make backwards-compatible changes:
Add new fields (with appropriate defaults)
Add new RPCs or methods
Add new enum values (at the end)
Make optional fields required is generally breaking
Q: Can different teams use different versions of the same API?#
A: Yes. Each major version is a separate Go module, so Team A can use v1 while Team B uses v2. This allows gradual migration without forcing everyone to upgrade simultaneously.
Development Workflow#
Q: Why are generated files not committed?#
A: Generated code is deterministic based on apx.lock. Not committing it:
Reduces merge conflicts
Ensures consistency across environments
Forces regeneration in CI for verification
Keeps repository clean and focused on source
Q: How do we handle local development with dependencies?#
A:
Use
apx addto pin dependencies inapx.lockRun
apx gen <language>to generate client codeImport generated code from
internal/gen/<language>/Never commit the
internal/gen/directory
CI/CD & Automation#
Q: How do we integrate APX with existing CI pipelines?#
A: Add APX validation to your existing workflows:
- run: apx fetch --ci # download tools
- run: apx lint # validate schemas
- run: apx breaking # check compatibility
- run: apx policy check # enforce governance
Q: What happens if app CI fails after tagging?#
A: The tag exists but no PR is created to the canonical repo. You can:
Fix the issues locally
Delete and recreate the tag
Push the corrected tag to trigger CI again
Q: Can we customize the PR created by apx publish?#
A: Yes, using flags:
apx publish \
--pr-title="Custom title" \
--pr-body="Custom description" \
--pr-labels="api,breaking-change"
Schema Formats#
Q: Does APX support formats other than Protocol Buffers?#
A: Yes. APX supports:
Protocol Buffers (primary, with buf integration)
OpenAPI (with oasdiff and Spectral)
Avro (with compatibility checking)
JSON Schema (with diff analysis)
Parquet (with custom compatibility rules)
Q: Can we mix schema formats in the same API?#
A: It’s possible but not recommended. Each format has different versioning and compatibility rules. Keep formats separate for cleaner governance and tooling.
Q: How does breaking change detection work for different formats?#
A: Each format uses specialized tools:
Proto:
buf breaking(file and wire compatibility)OpenAPI:
oasdiff breaking(API contract changes)Avro: compatibility modes (BACKWARD, FORWARD, FULL)
JSON Schema: schema diff analysis
Parquet: additive nullable columns only
Enterprise & Scale#
Q: How does APX handle large organizations with many teams?#
A:
CODEOWNERS provides per-API ownership
Domain organization groups related APIs
Catalog search helps discover existing APIs
Policy enforcement ensures consistency
Gradual rollout via feature flags
Q: Can we use APX with private/internal dependencies?#
A: Yes. APX works with private repositories by:
Using appropriate Git credentials
Configuring access tokens for CI
Supporting VPN/proxy environments
Allowing custom tool registries
Q: How do we handle API deprecation?#
A:
Mark APIs as deprecated in schema comments
Update catalog metadata
Set sunset timelines in documentation
Use
apx list dependentsto find consumersCoordinate migration with dependent teams
Performance & Optimization#
Q: How does APX handle large repositories?#
A:
Git subtree preserves complete commit history and authorship
Selective publishing only processes changed APIs
Cache optimization for tools and dependencies
Incremental processing to handle repository scale efficiently
Q: Can we run APX in containers for consistency?#
A: Yes. Use --use-container flag or APX_USE_CONTAINER=true environment variable to run all tools in containers. This ensures consistent environments across development and CI.
Q: How do we handle network restrictions?#
A: APX respects standard proxy settings:
export HTTP_PROXY=http://proxy.company.com:8080
export HTTPS_PROXY=http://proxy.company.com:8080
apx fetch # uses proxy for downloads
Troubleshooting#
Q: What if apx publish fails with merge conflicts?#
A:
Ensure canonical repo is up to date
Resolve conflicts manually if needed
Contact API governance team for assistance
Consider rebasing your changes before publishing
Q: How do we debug schema validation failures?#
A:
apx lint --verbose # detailed error output
buf lint <specific-file> # direct buf validation
apx config validate # check configuration
Q: What if dependencies can’t be resolved?#
A:
Check canonical repo accessibility
Verify version exists:
apx show <api>Clear cache:
rm -rf ~/.cache/apx/Re-fetch tools:
apx fetch --force
Can’t find your answer?
Check the Troubleshooting Guide
Open a Discussion
Report an Issue