Skip to content

Commit

Permalink
Merge 88cde50 into b090449
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdandm committed May 10, 2020
2 parents b090449 + 88cde50 commit fe3e40f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions README.md
Expand Up @@ -20,7 +20,7 @@ from JSON dataset.
* Handling **recursive data** structures (i.e family tree)
* Detecting **string serializable types** (i.e. datetime or just stringify numbers)
* Detecting fields containing string constants (`Literal['foo', 'bar']`)
* Generation models as **tree** (nested models) or **list**
* Generation models as **list** (flat models structure) or **tree** (nested models)
* Specifying when dictionaries should be processed as **`dict` type** (by default every dict is considered as some model)
* **CLI** API with a lot of options

Expand Down Expand Up @@ -103,7 +103,7 @@ driver_standings.json
```

```
json2models -f pydantic -s flat -l DriverStandings - driver_standings.json
json2models -f pydantic -l DriverStandings - driver_standings.json
```

```python
Expand Down Expand Up @@ -161,7 +161,7 @@ It requires a lit bit of tweaking:
* Disable string literals

```
json2models -s flat -f dataclasses -m Swagger testing_tools/swagger.json \
json2models -f dataclasses -m Swagger testing_tools/swagger.json \
--dict-keys-fields securityDefinitions paths responses definitions properties \
--merge percent_50 number --max-strings-literals 0
```
Expand Down Expand Up @@ -338,9 +338,9 @@ Arguments:
* **Default**: `-f base`

* `-s`, `--structure` - Models composition style.
* **Format**: `-s {nested, flat}`
* **Example**: `-s flat`
* **Default**: `-s nested`
* **Format**: `-s {flat, nested}`
* **Example**: `-s nested`
* **Default**: `-s flat`

* `--datetime` - Enable datetime/date/time strings parsing.
* **Default**: disabled
Expand Down
2 changes: 1 addition & 1 deletion json_to_models/cli.py
Expand Up @@ -268,7 +268,7 @@ def _create_argparser(cls) -> argparse.ArgumentParser:
)
parser.add_argument(
"-s", "--structure",
default="nested",
default="flat",
choices=list(cls.STRUCTURE_FN_MAPPING.keys()),
help="Models composition style. By default nested models become nested Python classes.\n\n"
)
Expand Down

0 comments on commit fe3e40f

Please sign in to comment.