schemathesis 3.35.3__py3-none-any.whl → 3.35.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -53,14 +53,15 @@ class OpenAPIParameter(Parameter):
53
53
  def as_json_schema(self, operation: APIOperation) -> dict[str, Any]:
54
54
  """Convert parameter's definition to JSON Schema."""
55
55
  # JSON Schema allows `examples` as an array
56
+ examples = []
56
57
  if self.examples_field in self.definition:
57
- examples = [
58
- example["value"] for example in self.definition[self.examples_field].values() if "value" in example
59
- ]
60
- else:
61
- examples = None
58
+ examples.extend(
59
+ [example["value"] for example in self.definition[self.examples_field].values() if "value" in example]
60
+ )
61
+ if self.example_field in self.definition:
62
+ examples.append(self.definition[self.example_field])
62
63
  schema = self.from_open_api_to_json_schema(operation, self.definition)
63
- if examples is not None:
64
+ if examples:
64
65
  schema["examples"] = examples
65
66
  return self.transform_keywords(schema)
66
67
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: schemathesis
3
- Version: 3.35.3
3
+ Version: 3.35.4
4
4
  Summary: Property-based testing framework for Open API and GraphQL based apps
5
5
  Project-URL: Documentation, https://schemathesis.readthedocs.io/en/stable/
6
6
  Project-URL: Changelog, https://schemathesis.readthedocs.io/en/stable/changelog.html
@@ -112,7 +112,7 @@ schemathesis/specs/openapi/formats.py,sha256=JmmkQWNAj5XreXb7Edgj4LADAf4m86YulR_
112
112
  schemathesis/specs/openapi/links.py,sha256=RvWJZqHfOeoNjhARBX9GSjG6mbQBwhMfB4-iEEQ9_TI,17737
113
113
  schemathesis/specs/openapi/loaders.py,sha256=MxzMoCufll_a_QFjQ9khBcM2dAD3cw8Fn6yCtpX_BzE,25628
114
114
  schemathesis/specs/openapi/media_types.py,sha256=dNTxpRQbY3SubdVjh4Cjb38R6Bc9MF9BsRQwPD87x0g,1017
115
- schemathesis/specs/openapi/parameters.py,sha256=UkTjSa4PE9nEBTljbRrwTcoKHYN8PFK7hBoR5qD9k6g,13932
115
+ schemathesis/specs/openapi/parameters.py,sha256=D3CUi-Ot_MqIjJ9kbbi6wTAcPB610N6rB2A2hwmtcGU,14021
116
116
  schemathesis/specs/openapi/references.py,sha256=euxM02kQGMHh4Ss1jWjOY_gyw_HazafKITIsvOEiAvI,9831
117
117
  schemathesis/specs/openapi/schemas.py,sha256=3pZEAU9sB9PT32z3BhJPsSSR0wVpJXL20-z9hMWS52s,53053
118
118
  schemathesis/specs/openapi/security.py,sha256=nEhDB_SvEFldmfpa9uOQywfWN6DtXHKmgtwucJvfN5Q,7096
@@ -147,8 +147,8 @@ schemathesis/transports/auth.py,sha256=yELjkEkfx4g74hNrd0Db9aFf0xDJDRIwhg2vzKOTZ
147
147
  schemathesis/transports/content_types.py,sha256=VrcRQvF5T_TUjrCyrZcYF2LOwKfs3IrLcMtkVSp1ImI,2189
148
148
  schemathesis/transports/headers.py,sha256=hr_AIDOfUxsJxpHfemIZ_uNG3_vzS_ZeMEKmZjbYiBE,990
149
149
  schemathesis/transports/responses.py,sha256=6-gvVcRK0Ho_lSydUysBNFWoJwZEiEgf6Iv-GWkQGd8,1675
150
- schemathesis-3.35.3.dist-info/METADATA,sha256=mvR0yYu9CyG09IvD4Dk8DBQ4vlLXKanpRpqshLdbgSQ,12856
151
- schemathesis-3.35.3.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
152
- schemathesis-3.35.3.dist-info/entry_points.txt,sha256=VHyLcOG7co0nOeuk8WjgpRETk5P1E2iCLrn26Zkn5uk,158
153
- schemathesis-3.35.3.dist-info/licenses/LICENSE,sha256=PsPYgrDhZ7g9uwihJXNG-XVb55wj2uYhkl2DD8oAzY0,1103
154
- schemathesis-3.35.3.dist-info/RECORD,,
150
+ schemathesis-3.35.4.dist-info/METADATA,sha256=Azro4LXmTzyRFoBWpAifkpar56gfhsDjpizNBWMMHe4,12856
151
+ schemathesis-3.35.4.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
152
+ schemathesis-3.35.4.dist-info/entry_points.txt,sha256=VHyLcOG7co0nOeuk8WjgpRETk5P1E2iCLrn26Zkn5uk,158
153
+ schemathesis-3.35.4.dist-info/licenses/LICENSE,sha256=PsPYgrDhZ7g9uwihJXNG-XVb55wj2uYhkl2DD8oAzY0,1103
154
+ schemathesis-3.35.4.dist-info/RECORD,,