Skip to content

Commit

Permalink
0.8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Hallett committed Oct 26, 2023
1 parent 668bd50 commit 758702b
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 14 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change log

## 0.8.2

- Improved json support

## 0.8.1

- Function parameters no longer format to snake_case to maintain consistency with the OpenAPI schema.
Expand Down
4 changes: 2 additions & 2 deletions clientele/generators/standard/templates/async_methods.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ async def get(url: str, headers: typing.Optional[dict] = None) -> httpx.Response

async def post(url: str, data: dict, headers: typing.Optional[dict] = None) -> httpx.Response:
"""Issue an HTTP POST request"""
json_data = json.dumps(data, default=json_serializer)
json_data = json.loads(json.dumps(data, default=json_serializer))
async with httpx.AsyncClient(headers=headers) as async_client:
return await async_client.post(parse_url(url), json=json_data, headers=headers)


async def put(url: str, data: dict, headers: typing.Optional[dict] = None) -> httpx.Response:
"""Issue an HTTP PUT request"""
json_data = json.dumps(data, default=json_serializer)
json_data = json.loads(json.dumps(data, default=json_serializer))
async with httpx.AsyncClient(headers=headers) as async_client:
return await async_client.put(parse_url(url), json=json_data, headers=headers)

Expand Down
4 changes: 2 additions & 2 deletions clientele/generators/standard/templates/sync_methods.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ def get(url: str, headers: typing.Optional[dict] = None) -> httpx.Response:

def post(url: str, data: dict, headers: typing.Optional[dict] = None) -> httpx.Response:
"""Issue an HTTP POST request"""
json_data = json.dumps(data, default=json_serializer)
json_data = json.loads(json.dumps(data, default=json_serializer))
return client.post(parse_url(url), json=json_data, headers=headers)


def put(url: str, data: dict, headers: typing.Optional[dict] = None) -> httpx.Response:
"""Issue an HTTP PUT request"""
json_data = json.dumps(data, default=json_serializer)
json_data = json.loads(json.dumps(data, default=json_serializer))
return client.put(parse_url(url), json=json_data, headers=headers)


Expand Down
2 changes: 1 addition & 1 deletion clientele/settings.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import platform

VERSION = "0.8.1"
VERSION = "0.8.2"


def split_ver():
Expand Down
4 changes: 4 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change log

## 0.8.2

- Improved json support

## 0.8.1

- Function parameters no longer format to snake_case to maintain consistency with the OpenAPI schema.
Expand Down
2 changes: 1 addition & 1 deletion docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ Once installed you can run `clientele version` to make sure you have the latest

```sh
> clientele version
clientele 0.8.1
clientele 0.8.2
```
2 changes: 1 addition & 1 deletion docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,5 @@ Print the current version of Clientele:

```sh
> clientele version
Clientele 0.8.1
Clientele 0.8.2
```
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "clientele"
version = "0.8.1"
version = "0.8.2"
description = "Generate loveable Python HTTP API Clients"
authors = ["Paul Hallett <paulandrewhallett@gmail.com>"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion tests/async_test_client/MANIFEST.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pipx install clientele

API VERSION: 0.1.0
OPENAPI VERSION: 3.0.2
CLIENTELE VERSION: 0.8.1
CLIENTELE VERSION: 0.8.2

Regnerate using this command:

Expand Down
4 changes: 2 additions & 2 deletions tests/async_test_client/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,14 @@ async def get(url: str, headers: typing.Optional[dict] = None) -> httpx.Response

async def post(url: str, data: dict, headers: typing.Optional[dict] = None) -> httpx.Response:
"""Issue an HTTP POST request"""
json_data = json.dumps(data, default=json_serializer)
json_data = json.loads(json.dumps(data, default=json_serializer))
async with httpx.AsyncClient(headers=headers) as async_client:
return await async_client.post(parse_url(url), json=json_data, headers=headers)


async def put(url: str, data: dict, headers: typing.Optional[dict] = None) -> httpx.Response:
"""Issue an HTTP PUT request"""
json_data = json.dumps(data, default=json_serializer)
json_data = json.loads(json.dumps(data, default=json_serializer))
async with httpx.AsyncClient(headers=headers) as async_client:
return await async_client.put(parse_url(url), json=json_data, headers=headers)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_client/MANIFEST.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pipx install clientele

API VERSION: 0.1.0
OPENAPI VERSION: 3.0.2
CLIENTELE VERSION: 0.8.1
CLIENTELE VERSION: 0.8.2

Regnerate using this command:

Expand Down
4 changes: 2 additions & 2 deletions tests/test_client/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,13 @@ def get(url: str, headers: typing.Optional[dict] = None) -> httpx.Response:

def post(url: str, data: dict, headers: typing.Optional[dict] = None) -> httpx.Response:
"""Issue an HTTP POST request"""
json_data = json.dumps(data, default=json_serializer)
json_data = json.loads(json.dumps(data, default=json_serializer))
return client.post(parse_url(url), json=json_data, headers=headers)


def put(url: str, data: dict, headers: typing.Optional[dict] = None) -> httpx.Response:
"""Issue an HTTP PUT request"""
json_data = json.dumps(data, default=json_serializer)
json_data = json.loads(json.dumps(data, default=json_serializer))
return client.put(parse_url(url), json=json_data, headers=headers)


Expand Down

0 comments on commit 758702b

Please sign in to comment.