Skip to content

Commit

Permalink
Merge pull request #43 from dapper91/dev
Browse files Browse the repository at this point in the history
- openapi dataclass alias setting bug fixed.
  • Loading branch information
dapper91 authored Sep 10, 2021
2 parents 7912204 + 3621ed1 commit cbf5c9e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ Changelog
=========


1.3.4 (2021-09-11)
------------------

- openapi dataclass alias setting bug fixed.


1.3.3 (2021-09-10)
------------------

Expand Down
2 changes: 1 addition & 1 deletion pjrpc/__about__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
__description__ = 'Extensible JSON-RPC library'
__url__ = 'https://github.com/dapper91/pjrpc'

__version__ = '1.3.3'
__version__ = '1.3.4'

__author__ = 'Dmitry Pershin'
__email__ = '[email protected]'
Expand Down
10 changes: 4 additions & 6 deletions pjrpc/server/specs/openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,8 @@ class SecurityScheme:

def __post_init__(self):
# `in` field name is not allowed in python
self.__dict__['in'] = self.__dict__.pop('location')
field = self.__dataclass_fields__['in'] = self.__dataclass_fields__.pop('location') # noqa
field.name = 'in'
self.__dict__['in'] = self.__dict__['location']
self.__dataclass_fields__['location'].name = 'in' # noqa


@dc.dataclass(frozen=False)
Expand Down Expand Up @@ -458,9 +457,8 @@ class Parameter:

def __post_init__(self):
# `in` field name is not allowed in python
self.__dict__['in'] = self.__dict__.pop('location')
field = self.__dataclass_fields__['in'] = self.__dataclass_fields__.pop('location') # noqa
field.name = 'in'
self.__dict__['in'] = self.__dict__['location']
self.__dataclass_fields__['location'].name = 'in' # noqa


@dc.dataclass(frozen=True)
Expand Down

0 comments on commit cbf5c9e

Please sign in to comment.