Skip to content

Commit

Permalink
update openapi generator target with spec from github, parameters now…
Browse files Browse the repository at this point in the history
… in order of original spec
  • Loading branch information
myrho committed Jan 25, 2024
1 parent e67cab6 commit b9baff3
Show file tree
Hide file tree
Showing 37 changed files with 67,433 additions and 4,816 deletions.
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@ drop-integration-db:
generate-openapi-server:
docker run --rm \
-v "${PWD}:/build:Z" \
-v "${PWD}/openapi_server/openapi/openapi.yaml:/spec.yaml" \
-v "${PWD}/templates:/templates" \
openapitools/openapi-generator-cli:v5.2.1 \
generate -i /spec.yaml \
generate -i "https://raw.githubusercontent.com/graphsense/graphsense-openapi/v$(GS_OPENAPI_VERSION)/graphsense.yaml" \
-g python-aiohttp \
-o /build \
-t /templates \
--additional-properties=packageVersion=$(RELEASE)
--additional-properties=packageVersion=$(GS_REST_SERVICE_VERSION)


get-openapi-spec-from-upstream:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The GraphSense REST Interface provides access to denormalized views computed
by the [graphsense-transformation][graphsense-transformation] pipeline.
It is used by the [graphsense-dashboard][graphsense-dashboard] component.

It is based on a server stub generated by the [OpenAPI Generator][openapi-generator] project against the [graphsense-openapi][graphsense-openapi] specification version 1.4.0.
It is based on a server stub generated by the [OpenAPI Generator][openapi-generator] project against the [graphsense-openapi][graphsense-openapi] specification version 1.4.1.
It uses the [Connexion][connexion] library on top of [aiohttp][aiohttp].

*Note:* This `README.md` is also generated. Changes must be made in
Expand Down
216 changes: 108 additions & 108 deletions openapi_server/models/actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,44 +16,44 @@ class Actor(Model):
Do not edit the class manually.
"""

def __init__(self, categories: List[LabeledItemRef]=None, context: ActorContext=None, id: str=None, jurisdictions: List[LabeledItemRef]=None, label: str=None, nr_tags: int=None, uri: str=None):
def __init__(self, id: str=None, label: str=None, uri: str=None, nr_tags: int=None, categories: List[LabeledItemRef]=None, jurisdictions: List[LabeledItemRef]=None, context: ActorContext=None):
"""Actor - a model defined in OpenAPI
:param categories: The categories of this Actor.
:param context: The context of this Actor.
:param id: The id of this Actor.
:param jurisdictions: The jurisdictions of this Actor.
:param label: The label of this Actor.
:param nr_tags: The nr_tags of this Actor.
:param uri: The uri of this Actor.
:param nr_tags: The nr_tags of this Actor.
:param categories: The categories of this Actor.
:param jurisdictions: The jurisdictions of this Actor.
:param context: The context of this Actor.
"""
self.openapi_types = {
'categories': List[LabeledItemRef],
'context': ActorContext,
'id': str,
'jurisdictions': List[LabeledItemRef],
'label': str,
'uri': str,
'nr_tags': int,
'uri': str
'categories': List[LabeledItemRef],
'jurisdictions': List[LabeledItemRef],
'context': ActorContext
}

self.attribute_map = {
'categories': 'categories',
'context': 'context',
'id': 'id',
'jurisdictions': 'jurisdictions',
'label': 'label',
'uri': 'uri',
'nr_tags': 'nr_tags',
'uri': 'uri'
'categories': 'categories',
'jurisdictions': 'jurisdictions',
'context': 'context'
}

self._categories = categories
self._context = context
self._id = id
self._jurisdictions = jurisdictions
self._label = label
self._nr_tags = nr_tags
self._uri = uri
self._nr_tags = nr_tags
self._categories = categories
self._jurisdictions = jurisdictions
self._context = context

@classmethod
def from_dict(cls, dikt: dict) -> 'Actor':
Expand All @@ -72,60 +72,14 @@ def to_dict(self, shallow=False):
"""
if not shallow:
return Model.to_dict(self)
return { 'categories': self._categories,
'context': self._context,
'id': self._id,
'jurisdictions': self._jurisdictions,
return { 'id': self._id,
'label': self._label,
'uri': self._uri,
'nr_tags': self._nr_tags,
'uri': self._uri }


@property
def categories(self):
"""Gets the categories of this Actor.
A list actor categories
:return: The categories of this Actor.
:rtype: List[LabeledItemRef]
"""
return self._categories

@categories.setter
def categories(self, categories):
"""Sets the categories of this Actor.
A list actor categories
:param categories: The categories of this Actor.
:type categories: List[LabeledItemRef]
"""
if categories is None:
raise BadUserInputException("Invalid value for `categories`, must not be `None`")

self._categories = categories

@property
def context(self):
"""Gets the context of this Actor.
:return: The context of this Actor.
:rtype: ActorContext
"""
return self._context

@context.setter
def context(self, context):
"""Sets the context of this Actor.
:param context: The context of this Actor.
:type context: ActorContext
"""
'categories': self._categories,
'jurisdictions': self._jurisdictions,
'context': self._context }

self._context = context

@property
def id(self):
Expand All @@ -152,31 +106,6 @@ def id(self, id):

self._id = id

@property
def jurisdictions(self):
"""Gets the jurisdictions of this Actor.
A list jurisdictions
:return: The jurisdictions of this Actor.
:rtype: List[LabeledItemRef]
"""
return self._jurisdictions

@jurisdictions.setter
def jurisdictions(self, jurisdictions):
"""Sets the jurisdictions of this Actor.
A list jurisdictions
:param jurisdictions: The jurisdictions of this Actor.
:type jurisdictions: List[LabeledItemRef]
"""
if jurisdictions is None:
raise BadUserInputException("Invalid value for `jurisdictions`, must not be `None`")

self._jurisdictions = jurisdictions

@property
def label(self):
"""Gets the label of this Actor.
Expand All @@ -202,6 +131,31 @@ def label(self, label):

self._label = label

@property
def uri(self):
"""Gets the uri of this Actor.
URI
:return: The uri of this Actor.
:rtype: str
"""
return self._uri

@uri.setter
def uri(self, uri):
"""Sets the uri of this Actor.
URI
:param uri: The uri of this Actor.
:type uri: str
"""
if uri is None:
raise BadUserInputException("Invalid value for `uri`, must not be `None`")

self._uri = uri

@property
def nr_tags(self):
"""Gets the nr_tags of this Actor.
Expand All @@ -226,26 +180,72 @@ def nr_tags(self, nr_tags):
self._nr_tags = nr_tags

@property
def uri(self):
"""Gets the uri of this Actor.
def categories(self):
"""Gets the categories of this Actor.
URI
A list actor categories
:return: The uri of this Actor.
:rtype: str
:return: The categories of this Actor.
:rtype: List[LabeledItemRef]
"""
return self._uri
return self._categories

@uri.setter
def uri(self, uri):
"""Sets the uri of this Actor.
@categories.setter
def categories(self, categories):
"""Sets the categories of this Actor.
URI
A list actor categories
:param uri: The uri of this Actor.
:type uri: str
:param categories: The categories of this Actor.
:type categories: List[LabeledItemRef]
"""
if uri is None:
raise BadUserInputException("Invalid value for `uri`, must not be `None`")
if categories is None:
raise BadUserInputException("Invalid value for `categories`, must not be `None`")

self._uri = uri
self._categories = categories

@property
def jurisdictions(self):
"""Gets the jurisdictions of this Actor.
A list jurisdictions
:return: The jurisdictions of this Actor.
:rtype: List[LabeledItemRef]
"""
return self._jurisdictions

@jurisdictions.setter
def jurisdictions(self, jurisdictions):
"""Sets the jurisdictions of this Actor.
A list jurisdictions
:param jurisdictions: The jurisdictions of this Actor.
:type jurisdictions: List[LabeledItemRef]
"""
if jurisdictions is None:
raise BadUserInputException("Invalid value for `jurisdictions`, must not be `None`")

self._jurisdictions = jurisdictions

@property
def context(self):
"""Gets the context of this Actor.
:return: The context of this Actor.
:rtype: ActorContext
"""
return self._context

@context.setter
def context(self, context):
"""Sets the context of this Actor.
:param context: The context of this Actor.
:type context: ActorContext
"""

self._context = context
Loading

0 comments on commit b9baff3

Please sign in to comment.