Skip to content

Commit

Permalink
Update openapi-generator
Browse files Browse the repository at this point in the history
  • Loading branch information
syucream committed Oct 5, 2024
1 parent 0c51579 commit 3068801
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion apiclient/typescript-fetch/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dmm-com/airone-apiclient-typescript-fetch",
"version": "0.0.19",
"version": "0.1.0",
"description": "AirOne APIv2 client in TypeScript",
"main": "src/autogenerated/index.ts",
"scripts": {
Expand Down
11 changes: 2 additions & 9 deletions frontend/src/repository/AironeApiClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,15 +181,10 @@ class AironeApiClient {
{
id,
aCL: {
id: id,
isPublic: isPublic,
defaultPermission: defaultPermission,
objtype: objectType,
aclSettings: aclSettings,
// readonly
name: "",
parent: null,
roles: [],
},
},
{
Expand Down Expand Up @@ -243,7 +238,6 @@ class AironeApiClient {
await this.entity.entityApiV2Create(
{
entityCreate: {
id: -1,
name: name,
note: note,
isToplevel: isToplevel,
Expand Down Expand Up @@ -272,7 +266,6 @@ class AironeApiClient {
{
id: id,
entityUpdate: {
id: id,
name: name,
note: note,
isToplevel: isToplevel,
Expand Down Expand Up @@ -364,7 +357,7 @@ class AironeApiClient {
attrs: AttributeData[]
): Promise<void> {
await this.entity.entityApiV2EntriesCreate(
{ entityId, entryCreate: { id: -1, name, attrs } },
{ entityId, entryCreate: { name, attrs } },
{
headers: {
"Content-Type": "application/json;charset=utf-8",
Expand All @@ -380,7 +373,7 @@ class AironeApiClient {
attrs: AttributeData[]
): Promise<void> {
await this.entry.entryApiV2Update(
{ id, entryUpdate: { id: id, name, attrs } },
{ id, entryUpdate: { name, attrs } },
{
headers: {
"Content-Type": "application/json;charset=utf-8",
Expand Down
5 changes: 5 additions & 0 deletions role/api_v2/serializers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from collections import OrderedDict

from drf_spectacular.utils import extend_schema_field
from rest_framework import serializers

from airone.lib.drf import RequiredParameterError
Expand Down Expand Up @@ -50,15 +51,19 @@ class Meta:
def get_filtered_data(self, obj, attribute, serializer):
return serializer(getattr(obj, attribute).filter(is_active=True), many=True).data

@extend_schema_field(RoleUserSerializer(many=True))
def get_users(self, obj):
return self.get_filtered_data(obj, "users", RoleUserSerializer)

@extend_schema_field(RoleUserSerializer(many=True))
def get_admin_users(self, obj):
return self.get_filtered_data(obj, "admin_users", RoleUserSerializer)

@extend_schema_field(RoleGroupSerializer(many=True))
def get_groups(self, obj):
return self.get_filtered_data(obj, "groups", RoleGroupSerializer)

@extend_schema_field(RoleGroupSerializer(many=True))
def get_admin_groups(self, obj):
return self.get_filtered_data(obj, "admin_groups", RoleGroupSerializer)

Expand Down
2 changes: 1 addition & 1 deletion tools/generate_client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -u

OPENAPI_GENERATOR_VERSION=v6.6.0
OPENAPI_GENERATOR_VERSION=v7.8.0
dst=${1:-frontend/src/apiclient/autogenerated}

# Check if "--docker" is passed as an argument
Expand Down

0 comments on commit 3068801

Please sign in to comment.