Skip to content

Commit cc3300a

Browse files
committed
Document org name normalization across language ecosystems
Add "Organization Name Normalization" section to multi-language strategy docs showing how hyphenated/mixed-case org names are translated per ecosystem (Python imports, Rust modules, C++ namespaces, Java packages, Docker images). Include a full derivation table for org=Acme-Corp. Cross-reference from the configuration reference org field and add a normalization checklist to the plugin CONTRIBUTING guide so new language authors handle dashes correctly.
1 parent 3ceb4e1 commit cc3300a

3 files changed

Lines changed: 43 additions & 1 deletion

File tree

docs/cli-reference/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ version: 1
3535
| Field | Type | Description |
3636
|-----------|--------|--------------------------------|
3737
| `version` | integer | Schema version number |
38-
| `org` | string | GitHub organization name |
38+
| `org` | string | GitHub organization name (hyphens and mixed case are normalized per-language; see [Org Name Normalization](../concepts/multi-language-strategy.md#organization-name-normalization)) |
3939
| `repo` | string | Canonical API repository name |
4040

4141
## Complete Field Reference

docs/concepts/multi-language-strategy.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,37 @@ Given `org=acme` and API path `proto/payments/ledger/v1`:
3030
```{include} ../_generated/identity-derivation-table.md
3131
```
3232

33+
## Organization Name Normalization
34+
35+
The `org` value from `apx.yaml` flows into every derived coordinate. Because each language ecosystem has its own identifier rules, APX normalizes the org name per-language:
36+
37+
| Context | Rule | `Acme-Corp` becomes |
38+
|---------|------|---------------------|
39+
| **Package manager names** (PyPI dist, Cargo crate, Conan ref, npm scope) | Lowercase only — hyphens are valid | `acme-corp` |
40+
| **OCI / Docker image refs** | Must be fully lowercase | `acme-corp` |
41+
| **Go module paths** | Case-insensitive (Git hosting) | `acme-corp` |
42+
| **Python imports** | Hyphens → underscores (Python identifiers) | `acme_corp_apis` |
43+
| **Rust module paths** | Hyphens → underscores (Rust identifiers) | `acme_corp_` |
44+
| **C++ namespaces** | Hyphens → underscores (C++ identifiers) | `acme_corp::` |
45+
| **Java packages** | Hyphens → dots (reverse-domain convention) | `com.acme.corp.apis` |
46+
47+
Given `org=Acme-Corp` and API path `proto/payments/ledger/v1`:
48+
49+
| Coordinate | Derived Value |
50+
|------------|---------------|
51+
| Go module | `github.com/Acme-Corp/apis/proto/payments/ledger` |
52+
| Py dist | `acme-corp-payments-ledger-v1` |
53+
| Py import | `acme_corp_apis.payments.ledger.v1` |
54+
| Crate | `acme-corp-payments-ledger-v1-proto` |
55+
| Rust mod | `acme_corp_payments::ledger::v1` |
56+
| Conan | `acme-corp-payments-ledger-v1-proto` |
57+
| C++ ns | `acme_corp::payments::ledger::v1` |
58+
| Maven | `com.acme.corp.apis:payments-ledger-v1-proto` |
59+
| Java pkg | `com.acme.corp.apis.payments.ledger.v1` |
60+
| npm | `@acme-corp/payments-ledger-v1-proto` |
61+
62+
**Key takeaway:** Hyphens in org names are fine. APX handles the per-ecosystem translation automatically. You never need to pre-normalize your org name.
63+
3364
## Go Workflow
3465

3566
Go is the Tier 1 language with the most mature overlay system:

internal/language/CONTRIBUTING.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ the release manifest.
1111
- Understand the APX API identity model (format/domain/name/line)
1212
- Know how the target language's package ecosystem works (naming, imports, registries)
1313

14+
## Org Name Normalization
15+
16+
The `org` value may contain hyphens (`acme-corp`) or mixed case (`Acme-Corp`).
17+
Your derivation functions **must** handle this correctly:
18+
19+
- **Package manager names** (crate, dist, npm scope) — lowercase only; hyphens are usually valid
20+
- **Language identifiers** (imports, modules, namespaces) — hyphens are typically invalid; replace with underscores or dots per the target language's rules
21+
22+
See existing plugins for patterns: Python (`_apis` namespace), Rust (`_` join),
23+
C++ (`_` replace), Java (hyphens → dots). Tests must include a `"hyphenated org"` case.
24+
1425
## Step-by-Step Checklist
1526

1627
### 1. Plugin Implementation (with Derivation)

0 commit comments

Comments
 (0)