Skip to content

Commit 24b5759

Browse files
authored
chore: add known limitations section to README (#1843)
Closes #1114 Adds a "Known Limitations" section to the README documenting current constraints that users should be aware of before using the library. This helps set expectations and reduces confusion when users encounter these limitations. Each limitation links to its tracking issue for visibility. --- ### Ask Yourself - [x] Have you reviewed the [contribution guide](https://github.com/cdklabs/json2jsii/blob/main/CONTRIBUTING.md)? - [x] Have you reviewed the [breaking changes guide](https://github.com/cdklabs/json2jsii/blob/main/CONTRIBUTING.md#breaking-changes)?
1 parent f7fa565 commit 24b5759

1 file changed

Lines changed: 34 additions & 3 deletions

File tree

README.md

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,24 +198,55 @@ interface TypeC {
198198
## Language bindings
199199

200200
Once you generate jsii-compatible TypeScript source (such as `person.ts` above),
201-
you can use [jsii-srcmak](https://github.com/eladb/jsii-srcmak) in order to
201+
you can use [jsii-srcmak](https://github.com/cdklabs/jsii-srcmak) in order to
202202
produce source code in any of the jsii supported languages.
203203

204204
The following command will produce Python sources for the `Person` types:
205205

206-
```shell
206+
```console
207207
$ jsii-srcmak gen/ts \
208208
--python-outdir gen/py --python-module-name person \
209209
--java-outdir gen/java --java-package person
210210
```
211211

212212
See the [jsii-srcmak](https://github.com/eladb/jsii-srcmak) for library usage.
213213

214+
## Known Limitations
215+
216+
### Unions of interfaces are not supported ([#1120](https://github.com/cdklabs/json2jsii/issues/1120))
217+
218+
Only primitive types are supported in `oneOf`/`anyOf` unions. Unions of complex types fall back to `any`:
219+
220+
```jsonc
221+
// ❌ Not supported - falls back to `any`
222+
{ "oneOf": [{ "$ref": "#/definitions/TypeA" }, { "$ref": "#/definitions/TypeB" }] }
223+
224+
// ✅ Supported - primitive union
225+
{ "oneOf": [{ "type": "string" }, { "type": "number" }] }
226+
```
227+
228+
### `$ref` must start with `#/definitions/` or `#/$defs/` ([#1195](https://github.com/cdklabs/json2jsii/issues/1195))
229+
230+
Only local definition references are supported:
231+
232+
```jsonc
233+
// ❌ Not supported
234+
{ "$ref": "#/properties/foo" }
235+
{ "$ref": "https://example.com/schemas/common.json" }
236+
237+
// ✅ Supported
238+
{ "$ref": "#/definitions/MyType" }
239+
{ "$ref": "#/$defs/MyType" }
240+
```
241+
242+
### Nested recursive local references fail ([#1197](https://github.com/cdklabs/json2jsii/issues/1197))
243+
244+
Code generation fails for schemas with nested recursive `$ref` patterns.
245+
214246
## Contributions
215247

216248
All contributions are celebrated.
217249

218250
## License
219251

220252
Distributed under the [Apache 2.0](./LICENSE) license.
221-

0 commit comments

Comments
 (0)