Skip to content

Commit

Permalink
Update OpenAPI spec to version 1.5 (#24)
Browse files Browse the repository at this point in the history
* Update OpenAPI spec to version 1.5

* Generate client
  • Loading branch information
ahornerr authored Aug 6, 2024
1 parent 5771401 commit d4efe12
Show file tree
Hide file tree
Showing 4 changed files with 316 additions and 131 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ all: install-tools fetch-spec process-spec generate-client test

process-spec:
openapi-down-convert --input spec/openapi.json --output spec/openapi-3.0.json
sed -i '' 's/"type": "null"/"nullable": true/g' spec/openapi-3.0.json
sed -i 's/"type": "null"/"nullable": true/g' spec/openapi-3.0.json

generate-client:
go generate ./...
Expand Down
165 changes: 149 additions & 16 deletions client/client.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

92 changes: 59 additions & 33 deletions spec/openapi-3.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"info": {
"title": "Artifacts API",
"description": "\nArtifacts is an API-based MMO game where you can manage 5 characters to explore, fight, gather resources, craft items and much more.\n\nWebsite: https://artifactsmmo.com/\n\nDocumentation: https://docs.artifactsmmo.com/\n\nOpenAPI Spec: https://api.artifactsmmo.com/openapi.json\n",
"version": "1.4"
"version": "1.5"
},
"paths": {
"/my/{name}/action/move": {
Expand Down Expand Up @@ -1420,6 +1420,46 @@
]
}
},
"/characters/delete": {
"post": {
"tags": [
"Characters"
],
"summary": "Delete Character",
"description": "Delete character on your account.",
"operationId": "delete_character_characters_delete_post",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DeleteCharacterSchema"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successfully deleted character.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CharacterResponseSchema"
}
}
}
},
"498": {
"description": "Character not found."
}
},
"security": [
{
"JWTBearer": []
}
]
}
},
"/characters/": {
"get": {
"tags": [
Expand Down Expand Up @@ -2670,7 +2710,7 @@
"destination": {
"allOf": [
{
"$ref": "#/components/schemas/DestinationResponseSchema"
"$ref": "#/components/schemas/MapSchema"
}
],
"description": "Destination details."
Expand Down Expand Up @@ -3905,6 +3945,23 @@
],
"title": "DataPage[SimpleItemSchema]"
},
"DeleteCharacterSchema": {
"properties": {
"name": {
"type": "string",
"maxLength": 12,
"minLength": 3,
"pattern": "^[a-zA-Z0-9_-]+$",
"title": "Name",
"description": "Character name."
}
},
"type": "object",
"required": [
"name"
],
"title": "DeleteCharacterSchema"
},
"DeleteItemResponseSchema": {
"properties": {
"data": {
Expand Down Expand Up @@ -3967,37 +4024,6 @@
],
"title": "DepositWithdrawGoldSchema"
},
"DestinationResponseSchema": {
"properties": {
"name": {
"type": "string",
"title": "Name",
"description": "The name of the destination."
},
"x": {
"type": "integer",
"title": "X",
"description": "The x coordinate of the destination."
},
"y": {
"type": "integer",
"title": "Y",
"description": "The y coordinate of the destination."
},
"content": {
"title": "Content",
"description": "Content of the destination."
}
},
"type": "object",
"required": [
"name",
"x",
"y",
"content"
],
"title": "DestinationResponseSchema"
},
"DestinationSchema": {
"properties": {
"x": {
Expand Down
Loading

0 comments on commit d4efe12

Please sign in to comment.