Skip to content
This repository has been archived by the owner on Dec 25, 2024. It is now read-only.

v3 convert nested schemas into sequential schemas #177

Merged
merged 57 commits into from
Jun 6, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
72ab53e
Writes nested schemas earlier and uses them later
spacether May 29, 2023
139003f
Refactors order CodegenSchema properties are set in to match the orde…
spacether May 31, 2023
8ffdd97
Adjusts ref input to setSchemaLocationInfo
spacether May 31, 2023
3bb45f5
Tweak improves schema template
spacether Jun 1, 2023
b75c129
Adds properties classes
spacether Jun 1, 2023
e499a61
Replaces properties with field
spacether Jun 1, 2023
94c8da6
Uses Schema_()
spacether Jun 1, 2023
be573a1
Uses dataclass properties
spacether Jun 1, 2023
1b23f54
Adds missing type info
spacether Jun 1, 2023
24b21e6
Updates all_of
spacether Jun 1, 2023
6b11b44
Adds any_of, all_of tuples
spacether Jun 1, 2023
9a4bde5
Fixes types definition
spacether Jun 1, 2023
8156a7a
Fixed test_any_type_schema tests
spacether Jun 1, 2023
7a620c8
Fixes dataclass type setting issues
spacether Jun 1, 2023
fcf53e3
Fixes simple schema format type
spacether Jun 1, 2023
fb5fd3d
Adds and uses PatternInfo for pattern schema info, validate_regex cha…
spacether Jun 1, 2023
14cf8b9
Fixes not constraint tests
spacether Jun 1, 2023
23a8a1d
Adds tuple_to_instance
spacether Jun 1, 2023
6a1c104
Writes out allOf/anyOf/oneOf types
spacether Jun 1, 2023
54a176d
Updates classproperty decorator
spacether Jun 2, 2023
c162dec
Adds enum return types
spacether Jun 2, 2023
d7803e1
Fixes type errors in schemas.py
spacether Jun 2, 2023
27f2475
Adds schema singleton metaclass
spacether Jun 2, 2023
0a1064d
Replaces CodegenServer variables with object schema containing variab…
spacether Jun 2, 2023
729944d
Generates server variables as an object schema to keep all schemas at…
spacether Jun 2, 2023
efd5a35
Fixes new signatures in servers schemas
spacether Jun 2, 2023
998762b
Simplifies Server variables definition
spacether Jun 2, 2023
46da2bc
Uses schema default for server variables
spacether Jun 3, 2023
0a744d1
Adds required vars in server definition
spacether Jun 3, 2023
a62f189
Fixes classproperty and SchemaBase classes
spacether Jun 3, 2023
a8aec72
Fixes broken configuration tests
spacether Jun 4, 2023
9416dcf
Fixes server docs
spacether Jun 4, 2023
1a09813
Adds isInlineDefinition
spacether Jun 5, 2023
5cc5c50
Adds allOf/anyOf/oneOf/properties jsonPathPiece
spacether Jun 5, 2023
eadd977
Uses jsonPathPiece in properties/allOf/anyOf/oneOf
spacether Jun 5, 2023
5dc4acf
Fixes properties typeddict name
spacether Jun 5, 2023
826ec84
Templates updated to write allOf/anyOf/oneOf/properties earlier if po…
spacether Jun 5, 2023
895304f
generates properties/allOf/anyOf/oneOf before class if possible
spacether Jun 5, 2023
b1b9389
Adds and uses schemas.INPUT_TYPES_ALL_INCL_SCHEMA
spacether Jun 5, 2023
bf3c818
Adds another usage of schemas.INPUT_TYPES_ALL_INCL_SCHEMA
spacether Jun 5, 2023
81095c1
Changes SchemaBase to SingletonMeta
spacether Jun 5, 2023
86a1b46
Only calculates allSchemas once
spacether Jun 5, 2023
81d20bf
Reduces iteration through allSchemas from 2x to 1x
spacether Jun 5, 2023
73aace1
Removes some getKey invocations
spacether Jun 6, 2023
21a5ae0
Consolidates more getKey usages
spacether Jun 6, 2023
5098218
Deletes getKey with one input
spacether Jun 6, 2023
18d9a29
Adds comment
spacether Jun 6, 2023
a87d6b6
Updates the definition of required properties, reduces the number of …
spacether Jun 6, 2023
ec8c6eb
Updates getKey to use sourceJsonPath
spacether Jun 6, 2023
ab1bca2
Adds class name generation that includes numbered suffixes when needed
spacether Jun 6, 2023
e09212c
Uses pre order traversal for naming schema classes
spacether Jun 6, 2023
f715b21
Fixes oneOf/anyOf/allOf type aliases
spacether Jun 6, 2023
df41b59
Adds and uses schemas.INPUT_BASE_TYPES
spacether Jun 6, 2023
bb9b6d1
Adds string representation of CodegenKey
spacether Jun 6, 2023
810c737
Fixes java tests
spacether Jun 6, 2023
b8287d6
Samples regenerated
spacether Jun 6, 2023
db29328
Samples regenerated
spacether Jun 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updates classproperty decorator
  • Loading branch information
spacether committed Jun 2, 2023
commit 54a176dfb07af9c810212f314e9532755bea1f52
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,15 @@ class Singleton:
return f'<{self.__class__.__name__}: {super().__repr__()}>'


class classproperty:

def __init__(self, fget):
self.fget = fget

def __get__(self, owner_self, owner_cls):
return self.fget(owner_cls)
class classproperty(typing.Generic[T]):
def __init__(self, method: typing.Callable[..., T]):
self.__method = method
functools.update_wrapper(self, method) # type: ignore

def __get__(self, obj, cls=None) -> T:
if cls is None:
cls = type(obj)
return self.__method.__get__(cls, cls)


class NoneClass(Singleton):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,15 @@ def __repr__(self):
return f'<{self.__class__.__name__}: {super().__repr__()}>'


class classproperty:

def __init__(self, fget):
self.fget = fget

def __get__(self, owner_self, owner_cls):
return self.fget(owner_cls)
class classproperty(typing.Generic[T]):
def __init__(self, method: typing.Callable[..., T]):
self.__method = method
functools.update_wrapper(self, method) # type: ignore

def __get__(self, obj, cls=None) -> T:
if cls is None:
cls = type(obj)
return self.__method.__get__(cls, cls)


class NoneClass(Singleton):
Expand Down