glideapps / glideapps/quicktype
patternProperties loses the type of the properties
- Dominant language
- TypeScript
- Stars
- 13.9k
- Forks
- 1.2k
- Avg merge
- 8h 53m
- Merged PRs (30d)
- 369
Description
When using the patternProperties feature (https://json-schema.org/understanding-json-schema/reference/object.html#pattern-properties), I have seen that the generated code correctly creates a map to things. Unfortunately these things are of a generic json type (even if I explicitly specify a type in my schema).
input schema:
```js
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"patternProperties": {
"^[a-zA-Z]\\w*$": {
"type": "boolean"
}
}
}
```
generated C++ Code:
```cpp
#pragma once
namespace quicktype {
using PatternProperties = std::map;
}
```
expected generated C++ Code:
```cpp
#pragma once
namespace quicktype {
using PatternProperties = std::map;
}
```
Contributor guide
Assessment
This issue has not been assessed yet.