Skip to content

Commit c886893

Browse files
Add more properties to the Schema class
1 parent 17cf112 commit c886893

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

openapidocs/v3.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,10 @@ class Schema(OpenAPIElement):
283283
properties (Optional[Dict[str, Union["Schema", "Reference"]]]):
284284
A dictionary of property names to their schemas or references.
285285
additional_properties (Union[None, bool, "Schema", "Reference"]):
286-
Indicates whether additional properties are allowed. If a schema or reference
287-
is provided, it defines the schema of the additional properties.
286+
Used to describe dictionaries. The additionalProperties keyword specifies
287+
the type of values in the dictionary. Values can be primitives (strings,
288+
numbers or boolean values), arrays or objects.
289+
https://swagger.io/docs/specification/v3_0/data-models/dictionaries/
288290
default (Optional[Any]):
289291
The default value for the schema.
290292
deprecated (Optional[bool]):
@@ -307,10 +309,20 @@ class Schema(OpenAPIElement):
307309
The maximum length for string values.
308310
min_length (Optional[float]):
309311
The minimum length for string values.
312+
max_items (Optional[int]):
313+
The maximum number of items in an array.
314+
min_items (Optional[int]):
315+
The minimum number of items in an array.
316+
unique_items (Optional[bool]):
317+
Indicates if all items in an array must be unique.
310318
maximum (Optional[float]):
311319
The maximum value for numeric values.
312320
minimum (Optional[float]):
313321
The minimum value for numeric values.
322+
nullable (Optional[bool]):
323+
Indicates if the value can be null.
324+
pattern (Optional[str]):
325+
A regular expression pattern for string values.
314326
xml (Optional[XML]):
315327
Additional metadata for XML representation.
316328
items (Union[None, "Schema", "Reference"]):
@@ -342,10 +354,15 @@ class Schema(OpenAPIElement):
342354
description: Optional[str] = None
343355
content_encoding: Optional[str] = None
344356
content_media_type: Optional[str] = None
357+
pattern: Optional[str] = None
345358
max_length: Optional[float] = None
346359
min_length: Optional[float] = None
360+
max_items: Optional[int] = None
361+
min_items: Optional[int] = None
362+
unique_items: Optional[bool] = None
347363
maximum: Optional[float] = None
348364
minimum: Optional[float] = None
365+
nullable: Optional[bool] = None
349366
xml: Optional[XML] = None
350367
items: Union[None, "Schema", "Reference"] = None
351368
enum: Optional[List[str]] = None

0 commit comments

Comments
 (0)