Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addititional fields in examples: #107

Closed
PaulRudin opened this issue Jul 4, 2024 · 1 comment
Closed

Addititional fields in examples: #107

PaulRudin opened this issue Jul 4, 2024 · 1 comment

Comments

@PaulRudin
Copy link

PaulRudin commented Jul 4, 2024

I'm not sure if I'm missing something here: but the extra keys after value don't seem to be consistent with the schema?

In [40]: s
Out[40]: 
{'properties': {'cost': {'title': 'Cost', 'type': 'integer'},
  'status': {'title': 'Status', 'type': 'string'},
  'limit': {'anyOf': [{'type': 'integer'}, {'type': 'null'}],
   'title': 'Limit'},
  'made': {'title': 'Made', 'type': 'integer'},
  'bank': {'title': 'Bank', 'type': 'integer'},
  'value': {'title': 'Value', 'type': 'integer'}},
 'required': ['cost', 'status', 'limit', 'made', 'bank', 'value'],
 'title': 'Transfers'}

In [41]: from_schema(s).example()
Out[41]: 
{'bank': 0,
 'cost': -7390,
 'limit': 50,
 'made': -41,
 'status': 'Ái\x06\U0005e6e1\U0004a007\x89\x03',
 'value': -26,
 '\x80': {'\U000a4f7f': []},
 '\t\U000b3fbdÁ': [],
 '': {'µdô®': {'¢wõ\r9': 8067779155734857896,
   'h\x14\U0001623cÖ\U00066a15': 55},
  '\x9eÖ': False,
  '-\U000bc341Ð]Íz\U000357ef\x19_D·V': []},
 'A;\U000f352b\U00077c83': {'': [["\x15×aLjt\x08\U0006c5ed\U0010397d'Ùca𫦎Ù-u\U001095ea{~\U001070cas",
    True,
    -1.9],
   115913850275016503743378305271649396131,
   '\U0005e84a\\\U000c9689\U00085d16'],
  'í': {"'\U000cc602©": [2.6508717339644708e+16, False, 'äý'],
   'º-½1¢êf\x9d\U000a3561': None},
  \U0009fab9\x82#': ']Ûë\x0b\x13\x89\U0010f9e1\x99𡠩Å'},
 '16}ý\U000876edX\x00Î\U00070475Ú߯\U0003dd16\U0002f529\U0003da36ø': [[[None,
    -1.0933940610632714e+157,
    None],
   ['\U0008bd4cF\xa0'],
   []],
  [-1.1125369292536007e-308, \x18\U0005a816Z', 1.1],
  {}]}
@Zac-HD
Copy link
Member

Zac-HD commented Jul 4, 2024

By default, extra keys are allowed! More details here.

@Zac-HD Zac-HD closed this as completed Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants