Ignore:
Timestamp:
Aug 11, 2023, 6:29:09 PM (15 months ago)
Author:
alloc
Message:

More OpenAPI specs added
OpenAPI specs cleanup to have everything validate fine
Added CORS support to API endpoints

Location:
TFP-WebServer/WebServer/src/WebAPI/APIs
Files:
5 added
3 edited

Legend:

Unmodified
Added
Removed
  • TFP-WebServer/WebServer/src/WebAPI/APIs/OpenAPI.openapi.yaml

    r459 r460  
    22info:
    33  title: OpenAPI
    4   version: 1
     4  version: '1'
    55
    66
     
    88  /api/OpenAPI/openapi.yaml:
    99    get:
     10      tags:
     11        - Meta
     12      summary: OpenAPI master document
     13      description: Fetch the OpenAPI master document, referencing all the individual WebAPI specs
    1014      operationId: OpenAPI.openapi
    1115      responses:
     
    1418            application/json: {}
    1519          description: OpenAPI master document
     20  /api/OpenAPI/{name}.openapi.yaml:
     21    get:
    1622      tags:
    1723        - Meta
    18   /api/OpenAPI/{name}.openapi.yaml:
    19     get:
     24      summary: OpenAPI spec for single API
     25      description: Fetch the OpenAPI spec of a single WebAPI
    2026      operationId: OpenAPI.getAPI
    2127      parameters:
     
    3541            application/json: {}
    3642          description: No OpenAPI spec found for the API name
    37       tags:
    38         - Meta
  • TFP-WebServer/WebServer/src/WebAPI/APIs/Permissions/Blacklist.cs

    r434 r460  
    100100                        }
    101101
    102                         bool validId = PlatformUserIdentifierAbs.TryFromCombinedString (id, out _userId);
    103                         if (!validId) {
     102                        if (PlatformUserIdentifierAbs.TryFromCombinedString (id, out _userId)) {
    104103                                SendEmptyResponse (_context, HttpStatusCode.BadRequest, _jsonInputData, "INVALID_USER");
     104                                return false;
    105105                        }
    106106
    107                         return validId;
     107                        return true;
    108108                }
    109109
  • TFP-WebServer/WebServer/src/WebAPI/APIs/WorldState/Animal.openapi.yaml

    r459 r460  
    22info:
    33  title: Animal
    4   version: 1
     4  version: '1'
    55
    66components:
     
    1010      properties:
    1111        id:
    12           $ref: '#/components/schemas/TypeEntityId'
     12          $ref: './openapi.yaml#/components/schemas/TypeEntityId'
    1313        name:
    1414          type: string
     
    1616            - animalStag
    1717        position:
    18           $ref: '#/components/schemas/TypeVector3i'
     18          $ref: './openapi.yaml#/components/schemas/TypeVector3i'
    1919      required:
    2020        - id
     
    4747                    $ref: '#/components/schemas/AnimalList'
    4848                  meta:
    49                     $ref: '#/components/schemas/ResultEnvelopeMeta'
     49                    $ref: './openapi.yaml#/components/schemas/ResultEnvelopeMeta'
    5050                required:
    5151                  - data
    5252                  - meta
    5353        403:
    54           $ref: '#/components/responses/Unauthorized'
     54          $ref: './openapi.yaml#/components/responses/Unauthorized'
    5555      security:
    5656        - apiTokenName: []
Note: See TracChangeset for help on using the changeset viewer.