Skip to content

Tags: microsoft/jschema-to-python

Tags

1.2.3

Toggle 1.2.3's commit message
Fix #13: Required property names are not translated to camelCase on o…

…utput.

For consistency with Python conventions, jschema-to-python maps property
names in the JSON schema (which are typically camelCase) to
underscore_separated attribute names in the generated Python classes.
The generated attributes include metadata that maps the Python property
names back to the original JSON schema property names. The to_json
method uses this metadata so that object models built with the generated
Python classes are correctly serialized to JSON that conforms to the
schema.

The bug here was that although optional properties contained this
metadata, required properties did not. This meant that if a required
JSON schema property consisted of more than one word (for example,
"fileChanges"), the Python object containing that property would be
serialized as "file_changes".

1.2.2

Toggle 1.2.2's commit message
Fix #11: Use attr.Factory instead of mutable initializers

1.2.1

Toggle 1.2.1's commit message
Fix bug in property renaming logic.

1.2.0

Toggle 1.2.0's commit message
Implement JSON serialization (moved from bandit-sarif-formatter).

1.1.4

Toggle 1.1.4's commit message
Include schema property name in attr.ib metadata.

1.1.3

Toggle 1.1.3's commit message
Fix install_requires in setup.cfg.

1.1.2

Toggle 1.1.2's commit message
Update Development Status to 5.

1.1.1

Toggle 1.1.1's commit message
Fix #6: Format with 'black' formatter.

1.1.0

Toggle 1.1.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Use attrs package and make Python 2/3 compatible. (#5)

Also:
- Fix bug in to_underscore_separated_name.

1.0.2

Toggle 1.0.2's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Address review feedback from MS Python team. (#3)

* Remove unnecessary calls to keys().
* Rely on truthiness checks.
* Use dict.get(key) instead of if key in dict.
* Print to sys.stdout instead of using self.file_obj.write.
* Underscores to hyphens in setup.cfg.
* Replace .format() print(x + y + z).
* Don't create output directory in initializer.
* Specify mode and encoding on all open() calls
* Use repr instead of custom util.quote.
* Use conventional module names
* DRY out construction of class module name.
* Use TypeError for missing arguments.
* Test "if missing_properties", not len().
* Add back a period.
* Remove format() calls in driver.py.