Skip to content

Commit ab5ea73

Browse files
committed
Updated docs for v0.8.1
Also updated the Swagger version to use the program version such that patch/build version numbers are used
1 parent b3e8210 commit ab5ea73

File tree

3 files changed

+25
-27
lines changed

3 files changed

+25
-27
lines changed

docs/ApiDocumentation.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# API Documentation
22

33
The following is generated from the [swagger.json](swagger.json) file via https://swagger-markdown-ui.netlify.app/
4-
54
# mGBA-http
65
An HTTP interface for mGBA scripting.
76

@@ -973,7 +972,7 @@ Write a 16-bit value from the given bus address.
973972
| Name | Located in | Description | Required | Schema |
974973
| ---- | ---------- | ----------- | -------- | ---- |
975974
| address | query | Address in hex, e.g. 0x0300 | Yes | string |
976-
| value | query | 16-bit decimal value to write (0-65535). | Yes | integer |
975+
| value | query | 16-bit unsigned integer value to write (0-65535). | Yes | integer |
977976

978977
##### Responses
979978

@@ -997,7 +996,7 @@ Write a 32-bit value from the given bus address.
997996
| Name | Located in | Description | Required | Schema |
998997
| ---- | ---------- | ----------- | -------- | ---- |
999998
| address | query | Address in hex, e.g. 0x0300 | Yes | string |
1000-
| value | query | 32-bit decimal value to write. | Yes | integer |
999+
| value | query | 32-bit unsigned integer value to write. | Yes | integer |
10011000

10021001
##### Responses
10031002

@@ -1304,19 +1303,19 @@ Get the size of this memory domain in bytes.
13041303
#### POST
13051304
##### Summary:
13061305

1307-
Write a 16-bit value to the given offset.
1306+
Write a 16-bit value from the given offset.
13081307

13091308
##### Description:
13101309

1311-
Write a 16-bit value to the given offset in the specified memory domain.
1310+
Write a 16-bit value from the given offset in the specified memory domain.
13121311

13131312
##### Parameters
13141313

13151314
| Name | Located in | Description | Required | Schema |
13161315
| ---- | ---------- | ----------- | -------- | ---- |
13171316
| memoryDomain | query | Memory domain name (e.g., 'wram', 'cart0', 'bios', etc). | Yes | string |
13181317
| address | query | Address as hex string with 0x prefix (e.g., '0x0300'). | Yes | string |
1319-
| value | query | 16-bit decimal value to write (0-65535). Not hex. | Yes | integer |
1318+
| value | query | 16-bit unsigned integer value to write (0-65535). Not hex. | Yes | integer |
13201319

13211320
##### Responses
13221321

@@ -1329,19 +1328,19 @@ Write a 16-bit value to the given offset in the specified memory domain.
13291328
#### POST
13301329
##### Summary:
13311330

1332-
Write a 32-bit value to the given offset.
1331+
Write a 32-bit value from the given offset.
13331332

13341333
##### Description:
13351334

1336-
Write a 32-bit value to the given offset in the specified memory domain.
1335+
Write a 32-bit value from the given offset in the specified memory domain.
13371336

13381337
##### Parameters
13391338

13401339
| Name | Located in | Description | Required | Schema |
13411340
| ---- | ---------- | ----------- | -------- | ---- |
13421341
| memoryDomain | query | Memory domain name (e.g., 'wram', 'cart0', 'bios', etc). | Yes | string |
13431342
| address | query | Address as hex string with 0x prefix (e.g., '0x0300'). | Yes | string |
1344-
| value | query | 32-bit decimal value to write. Not hex. | Yes | integer |
1343+
| value | query | 32-bit unsigned integer value to write (0-4294967295). Not hex. | Yes | integer |
13451344

13461345
##### Responses
13471346

@@ -1354,19 +1353,19 @@ Write a 32-bit value to the given offset in the specified memory domain.
13541353
#### POST
13551354
##### Summary:
13561355

1357-
Write an 8-bit value to the given offset.
1356+
Write an 8-bit value from the given offset.
13581357

13591358
##### Description:
13601359

1361-
Write an 8-bit value to the given offset in the specified memory domain.
1360+
Write an 8-bit value from the given offset in the specified memory domain.
13621361

13631362
##### Parameters
13641363

13651364
| Name | Located in | Description | Required | Schema |
13661365
| ---- | ---------- | ----------- | -------- | ---- |
13671366
| memoryDomain | query | Memory domain name (e.g., 'wram', 'cart0', 'bios', etc). | Yes | string |
13681367
| address | query | Address as hex string with 0x prefix (e.g., '0x0300'). | Yes | string |
1369-
| value | query | 8-bit decimal value to write (0-255). Not hex. | Yes | integer |
1368+
| value | query | 8-bit integer value to write (0-255). Not hex. | Yes | integer |
13701369

13711370
##### Responses
13721371

docs/swagger.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1459,7 +1459,7 @@
14591459
{
14601460
"name": "value",
14611461
"in": "query",
1462-
"description": "16-bit decimal value to write (0-65535).",
1462+
"description": "16-bit unsigned integer value to write (0-65535).",
14631463
"required": true,
14641464
"schema": {
14651465
"type": "integer",
@@ -1502,7 +1502,7 @@
15021502
{
15031503
"name": "value",
15041504
"in": "query",
1505-
"description": "32-bit decimal value to write.",
1505+
"description": "32-bit unsigned integer value to write.",
15061506
"required": true,
15071507
"schema": {
15081508
"type": "integer",
@@ -2002,8 +2002,8 @@
20022002
"tags": [
20032003
"MemoryDomain"
20042004
],
2005-
"summary": "Write a 16-bit value to the given offset.",
2006-
"description": "Write a 16-bit value to the given offset in the specified memory domain.",
2005+
"summary": "Write a 16-bit value from the given offset.",
2006+
"description": "Write a 16-bit value from the given offset in the specified memory domain.",
20072007
"parameters": [
20082008
{
20092009
"name": "memoryDomain",
@@ -2026,7 +2026,7 @@
20262026
{
20272027
"name": "value",
20282028
"in": "query",
2029-
"description": "16-bit decimal value to write (0-65535). Not hex.",
2029+
"description": "16-bit unsigned integer value to write (0-65535). Not hex.",
20302030
"required": true,
20312031
"schema": {
20322032
"type": "integer",
@@ -2054,8 +2054,8 @@
20542054
"tags": [
20552055
"MemoryDomain"
20562056
],
2057-
"summary": "Write a 32-bit value to the given offset.",
2058-
"description": "Write a 32-bit value to the given offset in the specified memory domain.",
2057+
"summary": "Write a 32-bit value from the given offset.",
2058+
"description": "Write a 32-bit value from the given offset in the specified memory domain.",
20592059
"parameters": [
20602060
{
20612061
"name": "memoryDomain",
@@ -2078,7 +2078,7 @@
20782078
{
20792079
"name": "value",
20802080
"in": "query",
2081-
"description": "32-bit decimal value to write. Not hex.",
2081+
"description": "32-bit unsigned integer value to write (0-4294967295). Not hex.",
20822082
"required": true,
20832083
"schema": {
20842084
"type": "integer",
@@ -2106,8 +2106,8 @@
21062106
"tags": [
21072107
"MemoryDomain"
21082108
],
2109-
"summary": "Write an 8-bit value to the given offset.",
2110-
"description": "Write an 8-bit value to the given offset in the specified memory domain.",
2109+
"summary": "Write an 8-bit value from the given offset.",
2110+
"description": "Write an 8-bit value from the given offset in the specified memory domain.",
21112111
"parameters": [
21122112
{
21132113
"name": "memoryDomain",
@@ -2130,7 +2130,7 @@
21302130
{
21312131
"name": "value",
21322132
"in": "query",
2133-
"description": "8-bit decimal value to write (0-255). Not hex.",
2133+
"description": "8-bit integer value to write (0-255). Not hex.",
21342134
"required": true,
21352135
"schema": {
21362136
"type": "integer",

src/mGBAHttp/Program.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
var version = Assembly.GetExecutingAssembly().GetName().Version;
1616
var programVersionString = $"v{version?.Major}.{version?.Minor}.{version?.Build}";
17-
var swaggerVersionString = $"v{version?.Major}.{version?.Minor}";
1817

1918
SetupConsoleAnsiSupport();
2019

@@ -40,7 +39,7 @@ ____ ____ _ _ _ _
4039
builder.Services.AddEndpointsApiExplorer();
4140
builder.Services.AddSwaggerGen(options =>
4241
{
43-
options.SwaggerDoc(swaggerVersionString, new OpenApiInfo
42+
options.SwaggerDoc(programVersionString, new OpenApiInfo
4443
{
4544
Title = "mGBA-http",
4645
Description = "An HTTP interface for mGBA scripting.",
@@ -83,12 +82,12 @@ ____ ____ _ _ _ _
8382
app.UseSwagger();
8483
app.UseSwaggerUI(options =>
8584
{
86-
options.SwaggerEndpoint($"/swagger/{swaggerVersionString}/swagger.json", swaggerVersionString);
85+
options.SwaggerEndpoint($"/swagger/{programVersionString}/swagger.json", programVersionString);
8786
options.RoutePrefix = string.Empty;
8887
});
8988

9089
Console.WriteLine("Swagger UI: /index.html");
91-
Console.WriteLine($"Swagger JSON: /swagger/{swaggerVersionString}/swagger.json\n");
90+
Console.WriteLine($"Swagger JSON: /swagger/{programVersionString}/swagger.json\n");
9291

9392
app.MapCoreEndpoints();
9493
app.MapConsoleEndpoints();

0 commit comments

Comments
 (0)