You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e087353
Browse filesBrowse the repository at this point in the historyBrowse files
responses((status = 200, description = "Successful health response", body = gfa_api_types::Health),(status = "default", description = "Structured recoverable error; local access requires a loopback peer and matching Host/Origin.", body = gfa_api_types::ErrorResponse))
144
+
)]
145
+
asyncfnhealth() -> Json<gfa_api_types::Health>{
146
+
Json(gfa_api_types::Health{
147
+
status:"ok".into(),
148
+
mode:"local".into(),
149
+
})
127
150
}
128
151
152
+
#[utoipa::path(
153
+
get, path = "/v1/games", tag = "Games",
154
+
155
+
156
+
responses((status = 200, description = "Successful games response", body = Vec<GameSpec>),(status = "default", description = "Structured recoverable error; local access requires a loopback peer and matching Host/Origin.", body = gfa_api_types::ErrorResponse))
params(("game_id" = String,Path, description = "Registered game identifier")),
166
+
responses((status = 200, description = "Successful game response", body = GameSpec),(status = "default", description = "Structured recoverable error; local access requires a loopback peer and matching Host/Origin.", body = gfa_api_types::ErrorResponse))
167
+
)]
133
168
asyncfngame(
134
169
State(service):State<Arc<GameService>>,
135
170
path:Id,
@@ -150,6 +185,12 @@ async fn game(
150
185
})
151
186
}
152
187
188
+
#[utoipa::path(
189
+
post, path = "/v1/matches", tag = "Matches",
190
+
request_body(content = gfa_api_types::CreateMatch, example = json!({"game_id":"tictactoe","seed":42})),
191
+
params(("seat" = Option<u8>,Query, description = "Zero-based seat; omit for spectator view. Creation and position validation default to seat 0.", minimum = 0, maximum = 255)),
192
+
responses((status = 201, description = "Successful create response", body = gfa_api_types::CreatedMatch),(status = "default", description = "Structured recoverable error; local access requires a loopback peer and matching Host/Origin.", body = gfa_api_types::ErrorResponse))
get, path = "/v1/matches/{id}/state", tag = "Matches",
207
+
208
+
params(("id" = String,Path, description = "Match identifier"),("seat" = Option<u8>,Query, description = "Zero-based seat; omit for spectator view. Creation and position validation default to seat 0.", minimum = 0, maximum = 255)),
209
+
responses((status = 200, description = "Successful state response", body = MatchState),(status = "default", description = "Structured recoverable error; local access requires a loopback peer and matching Host/Origin.", body = gfa_api_types::ErrorResponse))
210
+
)]
164
211
asyncfnstate(
165
212
State(service):State<Arc<GameService>>,
166
213
path:Id,
@@ -171,17 +218,32 @@ async fn state(
171
218
))
172
219
}
173
220
221
+
#[utoipa::path(
222
+
get, path = "/v1/matches/{id}/legal-actions", tag = "Matches",
223
+
224
+
params(("id" = String,Path, description = "Match identifier"),("seat" = Option<u8>,Query, description = "Zero-based seat; omit for spectator view. Creation and position validation default to seat 0.", minimum = 0, maximum = 255)),
225
+
responses((status = 200, description = "Successful legal actions response", body = gfa_api_types::LegalActions),(status = "default", description = "Structured recoverable error; local access requires a loopback peer and matching Host/Origin.", body = gfa_api_types::ErrorResponse))
0 commit comments