From 321c4d1b541bddc1a13035d1bc86c96bfdfa9ad1 Mon Sep 17 00:00:00 2001 From: Gibah Joseph Date: Tue, 18 Jul 2023 13:43:15 +0100 Subject: [PATCH] chore: removed logs --- example/tictactoe.yaml | 137 ++++++++++++++++++ .../lib/src/openapi_generator_runner.dart | 1 - 2 files changed, 137 insertions(+), 1 deletion(-) create mode 100644 example/tictactoe.yaml diff --git a/example/tictactoe.yaml b/example/tictactoe.yaml new file mode 100644 index 0000000..8d887da --- /dev/null +++ b/example/tictactoe.yaml @@ -0,0 +1,137 @@ +openapi: 3.1.0 +info: + title: Tic Tac Toe + description: | + This API allows writing down marks on a Tic Tac Toe board + and requesting the state of the board or of individual squares. + version: 1.0.0 +tags: + - name: Gameplay +paths: + # Whole board operations + /board: + get: + summary: Get the whole board + description: Retrieves the current state of the board and the winner. + tags: + - Gameplay + operationId: get-board + responses: + "200": + description: "OK" + content: + application/json: + schema: + $ref: "#/components/schemas/status" + + # Single square operations + /board/{row}/{column}: + parameters: + - $ref: "#/components/parameters/rowParam" + - $ref: "#/components/parameters/columnParam" + get: + summary: Get a single board square + description: Retrieves the requested square. + tags: + - Gameplay + operationId: get-square + responses: + "200": + description: "OK" + content: + application/json: + schema: + $ref: "#/components/schemas/mark" + "400": + description: The provided parameters are incorrect + content: + text/html: + schema: + $ref: "#/components/schemas/errorMessage" + example: "Illegal coordinates" + put: + summary: Set a single board square + description: Places a mark on the board and retrieves the whole board and the winner (if any). + tags: + - Gameplay + operationId: put-square + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/mark" + responses: + "200": + description: "OK" + content: + application/json: + schema: + $ref: "#/components/schemas/status" + "400": + description: The provided parameters are incorrect + content: + text/html: + schema: + $ref: "#/components/schemas/errorMessage" + examples: + illegalCoordinates: + value: "Illegal coordinates." + notEmpty: + value: "Square is not empty." + invalidMark: + value: "Invalid Mark (X or O)." + +components: + parameters: + rowParam: + description: Board row (vertical coordinate) + name: row + in: path + required: true + schema: + $ref: "#/components/schemas/coordinate" + columnParam: + description: Board column (horizontal coordinate) + name: column + in: path + required: true + schema: + $ref: "#/components/schemas/coordinate" + schemas: + errorMessage: + type: string + maxLength: 256 + description: A text message describing an error + coordinate: + type: integer + minimum: 1 + maximum: 3 + example: 1 + mark: + type: string + enum: [".", "X", "O"] + description: Possible values for a board square. `.` means empty square. + example: "." + board: + type: array + maxItems: 3 + minItems: 3 + items: + type: array + maxItems: 3 + minItems: 3 + items: + $ref: "#/components/schemas/mark" + winner: + type: string + enum: [".", "X", "O"] + description: Winner of the game. `.` means nobody has won yet. + example: "." + status: + type: object + properties: + winner: + $ref: "#/components/schemas/winner" + board: + $ref: "#/components/schemas/board" diff --git a/openapi-generator/lib/src/openapi_generator_runner.dart b/openapi-generator/lib/src/openapi_generator_runner.dart index e8be1c6..b9f8cd8 100755 --- a/openapi-generator/lib/src/openapi_generator_runner.dart +++ b/openapi-generator/lib/src/openapi_generator_runner.dart @@ -102,7 +102,6 @@ class OpenapiGenerator extends GeneratorForAnnotation { var exitCode = 0; var pr = await Process.run('java', arguments); - log.info(pr.stdout); if (pr.exitCode != 0) { log.severe(pr.stderr); }