From b112cca05c26d4b999525f56d73c3226c8df64fd Mon Sep 17 00:00:00 2001 From: Tomas Casas Date: Wed, 27 Nov 2024 10:45:45 -0300 Subject: [PATCH 01/30] Add /v1/job path --- management/job.yaml | 34 ++++++++++++++++++++++++++++++++++ management/openapi-3.yaml | 23 ++++++++++++++++++++++- 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 management/job.yaml diff --git a/management/job.yaml b/management/job.yaml new file mode 100644 index 0000000..52e5495 --- /dev/null +++ b/management/job.yaml @@ -0,0 +1,34 @@ +openapi: 3.0.1 +info: + title: Adzerk Management API - Advertisers + description: Advertiser related Adzerk Management API + version: "1.0" +servers: + - url: "https://api.adzerk.net" +tags: + - name: jobs + description: Create Jobs +paths: + /v1/job: + post: + tags: + - jobs + description: Create Jobs + operationId: createJob + security: + - ApiKeyAuth: [] + requestBody: + content: + application/json: + schema: + $ref: "./schemas/job.yaml#/schemas/JobInput" + responses: + 200: + description: Advertiser Created + content: + application/json: + schema: + $ref: "./schemas/job.yaml#/schemas/JobOutput" +components: + securitySchemes: + $ref: "./components/security-schemes.yaml#/components/securitySchemes" diff --git a/management/openapi-3.yaml b/management/openapi-3.yaml index cf0c933..991ad5c 100644 --- a/management/openapi-3.yaml +++ b/management/openapi-3.yaml @@ -36,6 +36,8 @@ tags: description: Ad Types - name: priorities description: Priorities + - name: jobs + description: Create Jobs paths: /v1/advertiser: post: @@ -2034,7 +2036,26 @@ paths: responses: 200: description: Successfully Deleted - + /v1/job: + post: + tags: + - jobs + description: Create Jobs + operationId: createJob + security: + - ApiKeyAuth: [] + requestBody: + content: + application/json: + schema: + $ref: './schemas/job.yaml#/schemas/JobInput' + responses: + 200: + description: Advertiser Created + content: + application/json: + schema: + $ref: './schemas/job.yaml#/schemas/JobOutput' components: schemas: CreativeTemplateUpdate: From 6f8bbef772f505e8efcba92c4ccd2f0b787d5f30 Mon Sep 17 00:00:00 2001 From: Tomas Casas Date: Wed, 27 Nov 2024 10:46:05 -0300 Subject: [PATCH 02/30] Ignore .vscode settings folder --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 0eabd95..b8ae6b6 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ build .env node_modules .secrets +.vscode From cf87d641ebe3f4dac300c5011e566b9af5921ace Mon Sep 17 00:00:00 2001 From: Tomas Casas Date: Wed, 27 Nov 2024 10:51:22 -0300 Subject: [PATCH 03/30] Switch to single quotes -- prettier --- management/openapi-3.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/management/openapi-3.yaml b/management/openapi-3.yaml index 991ad5c..4eae537 100644 --- a/management/openapi-3.yaml +++ b/management/openapi-3.yaml @@ -1039,7 +1039,7 @@ paths: format: int32 responses: 200: - description: "Successfully Deleted" + description: 'Successfully Deleted' '/v1/flight/{flightId}/sitezonetargeting': post: tags: From 233585b35ece986f65c07299b68876dc35dcd4fa Mon Sep 17 00:00:00 2001 From: Tomas Casas Date: Wed, 27 Nov 2024 10:51:42 -0300 Subject: [PATCH 04/30] Prefer $ref for securitySchemes entry --- management/openapi-3.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/management/openapi-3.yaml b/management/openapi-3.yaml index 4eae537..2aee87c 100644 --- a/management/openapi-3.yaml +++ b/management/openapi-3.yaml @@ -2061,7 +2061,4 @@ components: CreativeTemplateUpdate: $ref: './schemas/creative-template.yaml#/schemas/CreativeTemplateUpdate' securitySchemes: - ApiKeyAuth: - type: apiKey - in: header - name: X-Adzerk-ApiKey + $ref: './components/security-schemes.yaml#/components/securitySchemes' From 00306290fe2cf815bd976caa71a6305ccbf54c8f Mon Sep 17 00:00:00 2001 From: Tomas Casas Date: Wed, 27 Nov 2024 13:53:43 -0300 Subject: [PATCH 05/30] Fix Campaign schema --- management/schemas/campaign.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/management/schemas/campaign.yaml b/management/schemas/campaign.yaml index 85fb748..441b7ff 100644 --- a/management/schemas/campaign.yaml +++ b/management/schemas/campaign.yaml @@ -1,5 +1,4 @@ schemas: - CampaignBase: type: object required: @@ -56,12 +55,13 @@ schemas: format: int32 minimum: 0 nullable: true - Id: - type: integer - nullable: true CustomFieldsJson: type: string nullable: true + StartDate: + type: string + default: 1/1/2018 + deprecated: true EndDate: type: string nullable: true @@ -75,17 +75,17 @@ schemas: - $ref: '#/schemas/CampaignBase' - type: object required: - - CampaignId + - Id - StartDate properties: + Id: + type: integer + format: int32 + nullable: true SalespersonId: type: integer format: int32 nullable: true - StartDate: - type: string - default: 1/1/2018 - deprecated: true Flights: type: array items: From 8264dacc28150142293f97eae50bf50ad25228e1 Mon Sep 17 00:00:00 2001 From: Tomas Casas Date: Wed, 27 Nov 2024 13:56:07 -0300 Subject: [PATCH 06/30] Small Ad schema refactor --- management/ad.yaml | 119 +------------------------------------ management/openapi-3.yaml | 2 +- management/schemas/ad.yaml | 45 +++++++++----- 3 files changed, 31 insertions(+), 135 deletions(-) diff --git a/management/ad.yaml b/management/ad.yaml index 5bed5e8..a75953b 100644 --- a/management/ad.yaml +++ b/management/ad.yaml @@ -29,124 +29,7 @@ paths: content: application/json: schema: - type: object - required: - - Creative - - FlightId - - IsActive - properties: - Creative: - type: object - properties: - Id: - type: integer - format: int32 - FlightId: - type: integer - format: int32 - IsActive: - type: boolean - RtbCustomFields: - type: string - nullable: true - ActiveKeywords: - nullable: true - type: array - items: - type: string - CustomTargeting: - type: string - nullable: true - DistributionType: - type: integer - format: int32 - enum: [1, 2, 3] - nullable: true - Percentage: - type: integer - format: int32 - nullable: true - Impressions: - type: integer - format: int32 - nullable: true - SiteId: - type: integer - format: int32 - nullable: true - ZoneId: - type: integer - format: int32 - nullable: true - IsDeleted: - type: boolean - nullable: true - Iframe: - type: boolean - nullable: true - SizeOverride: - type: boolean - nullable: true - IsStartEndDateOverride: - type: boolean - nullable: true - StartDateIso: - type: string - format: date - nullable: true - EndDateIso: - type: string - format: date - nullable: true - IsGoalOverride: - type: boolean - nullable: true - GoalType: - type: integer - format: int32 - nullable: true - enum: [1, 2, 3, 7, 8, 9, 10] - Goal: - type: integer - format: int32 - nullable: true - IsNetworkAd: - type: boolean - nullable: true - IsNoTrack: - type: boolean - nullable: true - DontAffectParentFreqCap: - type: boolean - nullable: true - FreqCap: - type: integer - format: int32 - nullable: true - FreqCapDuration: - type: integer - format: int32 - nullable: true - FreqCapType: - type: integer - format: int32 - nullable: true - enum: [1, 2, 3] - Price: - type: number - format: float - nullable: true - ExternalMetadata: - type: string - nullable: true - CustomRelevancyScore: - type: integer - format: int32 - nullable: true - ProductId: - type: integer - format: int32 - nullable: true + $ref: './schemas/ad.yaml#/schemas/AdInput' responses: 200: description: The newly created Ad diff --git a/management/openapi-3.yaml b/management/openapi-3.yaml index 2aee87c..2b644bf 100644 --- a/management/openapi-3.yaml +++ b/management/openapi-3.yaml @@ -665,7 +665,7 @@ paths: content: application/json: schema: - type: object + $ref: './schemas/ad.yaml#/schemas/AdInput' responses: 200: description: The newly created Ad diff --git a/management/schemas/ad.yaml b/management/schemas/ad.yaml index fb58ad9..e54553f 100644 --- a/management/schemas/ad.yaml +++ b/management/schemas/ad.yaml @@ -1,28 +1,13 @@ schemas: - - Ad: + BaseAd: type: object required: - - CampaignId - Creative - IsActive - - FlightId properties: - CampaignId: - type: integer - format: int32 - nullable: true Creative: $ref: './creative.yaml#/schemas/Creative' nullable: true - FlightId: - type: integer - format: int32 - nullable: true - Id: - type: integer - format: int32 - nullable: true IsActive: type: boolean default: false @@ -41,6 +26,7 @@ schemas: DistributionType: type: integer format: int32 + enum: [1, 2, 3] Percentage: type: integer format: int32 @@ -84,6 +70,7 @@ schemas: type: integer format: int32 nullable: true + enum: [1, 2, 3, 7, 8, 9, 10] Goal: type: integer format: int32 @@ -109,6 +96,7 @@ schemas: type: integer format: int32 nullable: true + enum: [1, 2, 3] Price: type: number format: float @@ -137,6 +125,31 @@ schemas: format: int32 nullable: true + AdInput: + $ref: '#/schemas/AdBase' + + Ad: + allOf: + - $ref: '#/schemas/AdBase' + - type: object + required: + - Id + - FlightId + - CampaignId + properties: + CampaignId: + type: integer + format: int32 + nullable: true + FlightId: + type: integer + format: int32 + nullable: true + Id: + type: integer + format: int32 + nullable: true + AdList: type: object properties: From 4a2a760c407dcc2343b82a008079870f6703aac0 Mon Sep 17 00:00:00 2001 From: Tomas Casas Date: Wed, 27 Nov 2024 13:56:31 -0300 Subject: [PATCH 07/30] Add Asset schema for creation --- management/asset.yaml | 42 +++++++++++++++++ management/openapi-3.yaml | 30 ++++++++++++ management/schemas/asset.yaml | 87 +++++++++++++++++++++++++++++++++++ 3 files changed, 159 insertions(+) create mode 100644 management/asset.yaml create mode 100644 management/schemas/asset.yaml diff --git a/management/asset.yaml b/management/asset.yaml new file mode 100644 index 0000000..0d70240 --- /dev/null +++ b/management/asset.yaml @@ -0,0 +1,42 @@ +openapi: 3.0.1 +info: + title: Adzerk Management API - Entity Counts + description: Entity Counts related Adzerk Management API + version: '1.0' +servers: + - url: 'https://api.adzerk.net' +tags: + - name: entity-counts + description: Entity Counts +paths: + '/v1/advertiser/{advertiserId}/asset': + parameters: + - name: advertiserId + in: path + description: Id of the Advertiser to update + required: true + schema: + type: integer + post: + tags: + - assets + description: Create Assets + operationId: createAsset + security: + - ApiKeyAuth: [] + requestBody: + content: + application/json: + schema: + $ref: './schemas/asset.yaml#/schemas/AssetInput' + responses: + 200: + description: Asset Created + content: + application/json: + schema: + $ref: './schemas/asset.yaml#/schemas/Asset' + +components: + securitySchemes: + $ref: './components/security-schemes.yaml#/components/securitySchemes' diff --git a/management/openapi-3.yaml b/management/openapi-3.yaml index 2b644bf..29e4a19 100644 --- a/management/openapi-3.yaml +++ b/management/openapi-3.yaml @@ -38,6 +38,8 @@ tags: description: Priorities - name: jobs description: Create Jobs + - name: assets + description: Manage Assets paths: /v1/advertiser: post: @@ -2056,6 +2058,34 @@ paths: application/json: schema: $ref: './schemas/job.yaml#/schemas/JobOutput' + + '/v1/advertiser/{advertiserId}/asset': + parameters: + - name: advertiserId + in: path + description: Id of the Advertiser to update + required: true + schema: + type: integer + post: + tags: + - assets + description: Create Assets + operationId: createAsset + security: + - ApiKeyAuth: [] + requestBody: + content: + application/json: + schema: + $ref: './schemas/asset.yaml#/schemas/AssetInput' + responses: + 200: + description: Asset Created + content: + application/json: + schema: + $ref: './schemas/asset.yaml#/schemas/Asset' components: schemas: CreativeTemplateUpdate: diff --git a/management/schemas/asset.yaml b/management/schemas/asset.yaml new file mode 100644 index 0000000..4a12d6f --- /dev/null +++ b/management/schemas/asset.yaml @@ -0,0 +1,87 @@ +schemas: + BaseAsset: + type: object + required: + - Name + - Type + properties: + Name: + type: string + Type: + type: string + enum: ['video', 'image'] + ContentURL: + type: string + format: uri + nullable: true + + AssetInput: + $ref: '#/schemas/AssetBase' + + Asset: + allOf: + - $ref: '#/schemas/AssetBase' + - type: object + required: + - Id + - Status + - AdvertiserId + properties: + AdvertiserId: + type: integer + format: int32 + nullable: true + Id: + type: integer + format: int32 + nullable: true + Status: + type: string + UploadURL: + type: string + format: uri + nullable: true + IsDeleted: + type: boolean + nullable: true + + AssetDetails: + allOf: + - $ref: '#/schemas/Asset' + - type: object + properties: + Metadata: + type: object + properties: + Height: + type: integer + Width: + type: integer + FileExtension: + type: string + AspectRatio: + type: string + Duration: + type: number + PlaybackId: + type: string + + AssetList: + type: object + properties: + page: + type: integer + format: int32 + pageSize: + type: integer + format: int32 + totalPages: + type: integer + format: int32 + totalItems: + type: integer + format: int64 + items: + type: array + items: + $ref: '#/schemas/Asset' From 224026033c1b69a86d22dfd16feda06892e3c1d0 Mon Sep 17 00:00:00 2001 From: Tomas Casas Date: Wed, 27 Nov 2024 18:40:07 -0300 Subject: [PATCH 08/30] Complete asset paths --- management/asset.yaml | 152 ++++++++++++++++++++++++++++++++++++- management/openapi-3.yaml | 154 +++++++++++++++++++++++++++++++++++++- 2 files changed, 303 insertions(+), 3 deletions(-) diff --git a/management/asset.yaml b/management/asset.yaml index 0d70240..dc8260f 100644 --- a/management/asset.yaml +++ b/management/asset.yaml @@ -9,14 +9,101 @@ tags: - name: entity-counts description: Entity Counts paths: + /v1/asset: + get: + tags: + - assets + description: list Assets + operationId: listAssets + security: + - ApiKeyAuth: [] + parameters: + - name: pageSize + in: query + description: The size of the page to be returned + required: false + schema: + type: integer + format: int32 + nullable: true + - name: page + in: query + description: The page number to be returned + required: false + schema: + type: integer + format: int32 + nullable: true + responses: + 200: + description: Paged list of Assets + content: + application/json: + schema: + $ref: './schemas/asset.yaml#/schemas/AssetList' + '/v1/asset/{assetId}': + parameters: + - name: assetId + in: path + description: Id of the Asset to get + required: true + schema: + type: integer + format: int32 + get: + tags: + - assets + description: Get an existing Asset + operationId: getAsset + security: + - ApiKeyAuth: [] + responses: + 200: + description: The existing Asset + content: + application/json: + schema: + $ref: './schemas/asset.yaml#/schemas/AssetDetails' '/v1/advertiser/{advertiserId}/asset': parameters: - name: advertiserId in: path - description: Id of the Advertiser to update + description: Id of the Advertiser required: true schema: type: integer + format: int32 + get: + tags: + - assets + description: List Assets for Advertiser + operationId: listAdvertiserAssets + security: + - ApiKeyAuth: [] + parameters: + - name: pageSize + in: query + description: The size of the page to be returned + required: false + schema: + type: integer + format: int32 + nullable: true + - name: page + in: query + description: The page number to be returned + required: false + schema: + type: integer + format: int32 + nullable: true + responses: + 200: + description: Paged list of Assets for Advertiser + content: + application/json: + schema: + $ref: './schemas/asset.yaml#/schemas/AssetList' post: tags: - assets @@ -36,6 +123,69 @@ paths: application/json: schema: $ref: './schemas/asset.yaml#/schemas/Asset' + '/v1/asset/{assetId}/delete': + parameters: + - name: assetId + in: path + description: Id of the Asset to delete + required: true + schema: + type: integer + format: int32 + post: + tags: + - assets + description: Delete an existing Asset + operationId: deleteAsset + security: + - ApiKeyAuth: [] + responses: + 200: + description: Successfully Deleted + 'v1/asset/{assetId}/upload': + parameters: + - name: assetId + in: path + description: Id of the Asset to delete + required: true + schema: + type: integer + format: int32 + post: + tags: + - assets + description: Upload an existing Asset Content + operationId: uploadAssetContent + security: + - ApiKeyAuth: [] + requestBody: + required: true + content: + image/*: + schema: + type: string + format: binary + description: Binary data for image files. + video/*: + schema: + type: string + format: base64 + description: Binary data for video files. + application/octet-stream: + schema: + type: string + format: base64 + description: Binary data for video or image files. + multipart/form-data: + schema: + type: object + properties: + file: + type: string + format: binary + responses: + 200: + description: Successfully Uploaded components: securitySchemes: diff --git a/management/openapi-3.yaml b/management/openapi-3.yaml index 29e4a19..f56432a 100644 --- a/management/openapi-3.yaml +++ b/management/openapi-3.yaml @@ -2058,15 +2058,101 @@ paths: application/json: schema: $ref: './schemas/job.yaml#/schemas/JobOutput' - + /v1/asset: + get: + tags: + - assets + description: list Assets + operationId: listAssets + security: + - ApiKeyAuth: [] + parameters: + - name: pageSize + in: query + description: The size of the page to be returned + required: false + schema: + type: integer + format: int32 + nullable: true + - name: page + in: query + description: The page number to be returned + required: false + schema: + type: integer + format: int32 + nullable: true + responses: + 200: + description: Paged list of Assets + content: + application/json: + schema: + $ref: './schemas/asset.yaml#/schemas/AssetList' + '/v1/asset/{assetId}': + parameters: + - name: assetId + in: path + description: Id of the Asset to get + required: true + schema: + type: integer + format: int32 + get: + tags: + - assets + description: Get an existing Asset + operationId: getAsset + security: + - ApiKeyAuth: [] + responses: + 200: + description: The existing Asset + content: + application/json: + schema: + $ref: './schemas/asset.yaml#/schemas/AssetDetails' '/v1/advertiser/{advertiserId}/asset': parameters: - name: advertiserId in: path - description: Id of the Advertiser to update + description: Id of the Advertiser required: true schema: type: integer + format: int32 + get: + tags: + - assets + description: List Assets for Advertiser + operationId: listAdvertiserAssets + security: + - ApiKeyAuth: [] + parameters: + - name: pageSize + in: query + description: The size of the page to be returned + required: false + schema: + type: integer + format: int32 + nullable: true + - name: page + in: query + description: The page number to be returned + required: false + schema: + type: integer + format: int32 + nullable: true + responses: + 200: + description: Paged list of Assets for Advertiser + content: + application/json: + schema: + $ref: './schemas/asset.yaml#/schemas/AssetList' post: tags: - assets @@ -2086,6 +2172,70 @@ paths: application/json: schema: $ref: './schemas/asset.yaml#/schemas/Asset' + '/v1/asset/{assetId}/delete': + parameters: + - name: assetId + in: path + description: Id of the Asset to delete + required: true + schema: + type: integer + format: int32 + post: + tags: + - assets + description: Delete an existing Asset + operationId: deleteAsset + security: + - ApiKeyAuth: [] + responses: + 200: + description: Successfully Deleted + 'v1/asset/{assetId}/upload': + parameters: + - name: assetId + in: path + description: Id of the Asset to delete + required: true + schema: + type: integer + format: int32 + post: + tags: + - assets + description: Upload an existing Asset Content + operationId: uploadAssetContent + security: + - ApiKeyAuth: [] + requestBody: + required: true + content: + image/*: + schema: + type: string + format: binary + description: Binary data for image files. + video/*: + schema: + type: string + format: base64 + description: Binary data for video files. + application/octet-stream: + schema: + type: string + format: base64 + description: Binary data for video or image files. + multipart/form-data: + schema: + type: object + properties: + file: + type: string + format: binary + responses: + 200: + description: Successfully Uploaded + components: schemas: CreativeTemplateUpdate: From 55d834b7d87e1610bf4a187c40eab246d7443c27 Mon Sep 17 00:00:00 2001 From: Tomas Casas Date: Wed, 27 Nov 2024 22:16:59 -0300 Subject: [PATCH 09/30] Reshape Job paths and schemas --- management/job.yaml | 76 ++++++++++++++++++++++-- management/openapi-3.yaml | 68 +++++++++++++++++++++- management/schemas/job.yaml | 113 +++++++++++++++++++++++++++++++++++- 3 files changed, 248 insertions(+), 9 deletions(-) diff --git a/management/job.yaml b/management/job.yaml index 52e5495..e8e2588 100644 --- a/management/job.yaml +++ b/management/job.yaml @@ -2,14 +2,80 @@ openapi: 3.0.1 info: title: Adzerk Management API - Advertisers description: Advertiser related Adzerk Management API - version: "1.0" + version: '1.0' servers: - - url: "https://api.adzerk.net" + - url: 'https://api.adzerk.net' tags: - name: jobs description: Create Jobs paths: + /v1/job/{jobId}: + get: + tags: + - jobs + description: List Jobs + operationId: listJobs + security: + - ApiKeyAuth: [] + parameters: + - name: jobId + in: path + description: The Job Id + required: true + schema: + type: integer + format: int32 + - name: verbose + in: query + description: Whether to return TaskArgs and Output attributes in returned jobs + required: false + schema: + type: boolean + responses: + 200: + description: The existing Job + content: + application/json: + schema: + $ref: './schemas/job.yaml#/schemas/Job' /v1/job: + get: + tags: + - jobs + description: List Jobs + operationId: listJobs + security: + - ApiKeyAuth: [] + parameters: + - name: verbose + in: query + description: Whether to return TaskArgs and Output attributes in returned jobs + required: false + schema: + type: boolean + - name: pageSize + in: query + description: The size of the page to be returned + required: false + schema: + type: integer + format: int32 + nullable: true + - name: page + in: query + description: The page number to be returned + required: false + schema: + type: integer + format: int32 + nullable: true + responses: + 200: + description: A paged list of Jobs + content: + application/json: + schema: + $ref: './schemas/job.yaml#/schemas/JobList' post: tags: - jobs @@ -21,14 +87,14 @@ paths: content: application/json: schema: - $ref: "./schemas/job.yaml#/schemas/JobInput" + $ref: './schemas/job.yaml#/schemas/JobInput' responses: 200: description: Advertiser Created content: application/json: schema: - $ref: "./schemas/job.yaml#/schemas/JobOutput" + $ref: './schemas/job.yaml#/schemas/Job' components: securitySchemes: - $ref: "./components/security-schemes.yaml#/components/securitySchemes" + $ref: './components/security-schemes.yaml#/components/securitySchemes' diff --git a/management/openapi-3.yaml b/management/openapi-3.yaml index f56432a..e117005 100644 --- a/management/openapi-3.yaml +++ b/management/openapi-3.yaml @@ -2038,7 +2038,73 @@ paths: responses: 200: description: Successfully Deleted + /v1/job/{jobId}: + get: + tags: + - jobs + description: List Jobs + operationId: listJobs + security: + - ApiKeyAuth: [] + parameters: + - name: jobId + in: path + description: The Job Id + required: true + schema: + type: integer + format: int32 + - name: verbose + in: query + description: Whether to return TaskArgs and Output attributes in returned jobs + required: false + schema: + type: boolean + responses: + 200: + description: The existing Job + content: + application/json: + schema: + $ref: './schemas/job.yaml#/schemas/Job' /v1/job: + get: + tags: + - jobs + description: List Jobs + operationId: listJobs + security: + - ApiKeyAuth: [] + parameters: + - name: verbose + in: query + description: Whether to return TaskArgs and Output attributes in returned jobs + required: false + schema: + type: boolean + - name: pageSize + in: query + description: The size of the page to be returned + required: false + schema: + type: integer + format: int32 + nullable: true + - name: page + in: query + description: The page number to be returned + required: false + schema: + type: integer + format: int32 + nullable: true + responses: + 200: + description: A paged list of Jobs + content: + application/json: + schema: + $ref: './schemas/job.yaml#/schemas/JobList' post: tags: - jobs @@ -2057,7 +2123,7 @@ paths: content: application/json: schema: - $ref: './schemas/job.yaml#/schemas/JobOutput' + $ref: './schemas/job.yaml#/schemas/Job' /v1/asset: get: tags: diff --git a/management/schemas/job.yaml b/management/schemas/job.yaml index bd3b723..183dcc4 100644 --- a/management/schemas/job.yaml +++ b/management/schemas/job.yaml @@ -1,4 +1,36 @@ schemas: + Override: + type: Object + properties: + source: + type: string + target: + type: array + items: + type: string + op: + type: string + enum: ['op', 'literal', 'stringify', 'stringify-array'] + + Task: + type: object + properties: + ProductUris: + type: array + items: + type: string + format: uri + AdTemplateUri: + type: string + format: uri + FlightId: + type: integer + format: int32 + Overrides: + type: object + description: 'A map or ProductUri keys with Override values' + additionalProperties: + $ref: '#/schemas/Override' JobInput: type: object @@ -9,15 +41,90 @@ schemas: type: string maxLength: 100 TaskArgs: - type: object + $ref: '#/schemas/Task' PartitionId: type: string - JobOutput: + SuccessfulOutput: + type: object + properties: + errors: + type: array + items: + type: object + properties: + required: + - message + message: + type: string + + CompletedOutput: + type: object + required: + - AdIds + properties: + AdIds: + type: array + items: + type: integer + format: int32 + + FailedOutput: + type: object + required: + - errors + properties: + errors: + type: array + items: + type: object + properties: + required: + - message + message: + type: string + + Job: type: object required: - - Id + - TaskId properties: + CompletedTime: + type: string + NetworkId: + type: integer + Status: + type: string + TaskArgs: + $ref: '#/schemas/Task' + AvailableTime: + type: string + Output: + type: object + anyOf: + - $ref: '#/schemas/CompletedOutput' + - $ref: '#/schemas/FailedOutput' Id: type: integer + PartitionId: + type: string + + JobList: + type: object + properties: + page: + type: integer format: int32 + pageSize: + type: integer + format: int32 + totalPages: + type: integer + format: int32 + totalItems: + type: integer + format: int64 + items: + type: array + items: + $ref: '#/schemas/Job' From aea482f9c27181dffa6e7c2de3c274b3045d8912 Mon Sep 17 00:00:00 2001 From: Tomas Casas Date: Thu, 28 Nov 2024 15:19:31 -0300 Subject: [PATCH 10/30] Allow additional properties on AdInput This seems slightly redundant based on testing. The AdBase seems to accept additional properties by default. Keeping it avoid potential defaults being different where consumed. --- management/schemas/ad.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/management/schemas/ad.yaml b/management/schemas/ad.yaml index e54553f..352069e 100644 --- a/management/schemas/ad.yaml +++ b/management/schemas/ad.yaml @@ -126,7 +126,10 @@ schemas: nullable: true AdInput: - $ref: '#/schemas/AdBase' + allOf: + - $ref: '#/schemas/AdBase' + - type: object + additionalProperties: true Ad: allOf: From e8b280de5ecdb744fa75618cce4959b42d8f17b4 Mon Sep 17 00:00:00 2001 From: Tomas Casas Date: Thu, 28 Nov 2024 15:24:43 -0300 Subject: [PATCH 11/30] Removed unsupported content types --- management/asset.yaml | 15 --------------- management/openapi-3.yaml | 15 --------------- 2 files changed, 30 deletions(-) diff --git a/management/asset.yaml b/management/asset.yaml index dc8260f..2bb1c15 100644 --- a/management/asset.yaml +++ b/management/asset.yaml @@ -161,21 +161,6 @@ paths: requestBody: required: true content: - image/*: - schema: - type: string - format: binary - description: Binary data for image files. - video/*: - schema: - type: string - format: base64 - description: Binary data for video files. - application/octet-stream: - schema: - type: string - format: base64 - description: Binary data for video or image files. multipart/form-data: schema: type: object diff --git a/management/openapi-3.yaml b/management/openapi-3.yaml index e117005..a476fd5 100644 --- a/management/openapi-3.yaml +++ b/management/openapi-3.yaml @@ -2276,21 +2276,6 @@ paths: requestBody: required: true content: - image/*: - schema: - type: string - format: binary - description: Binary data for image files. - video/*: - schema: - type: string - format: base64 - description: Binary data for video files. - application/octet-stream: - schema: - type: string - format: base64 - description: Binary data for video or image files. multipart/form-data: schema: type: object From 3db9deaa497cfbafd238d84c26db437ff1dc8a07 Mon Sep 17 00:00:00 2001 From: Tomas Casas Date: Thu, 28 Nov 2024 15:25:32 -0300 Subject: [PATCH 12/30] Make path absolute --- management/asset.yaml | 2 +- management/openapi-3.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/management/asset.yaml b/management/asset.yaml index 2bb1c15..d7d8c5e 100644 --- a/management/asset.yaml +++ b/management/asset.yaml @@ -142,7 +142,7 @@ paths: responses: 200: description: Successfully Deleted - 'v1/asset/{assetId}/upload': + '/v1/asset/{assetId}/upload': parameters: - name: assetId in: path diff --git a/management/openapi-3.yaml b/management/openapi-3.yaml index a476fd5..25a1c6d 100644 --- a/management/openapi-3.yaml +++ b/management/openapi-3.yaml @@ -2257,7 +2257,7 @@ paths: responses: 200: description: Successfully Deleted - 'v1/asset/{assetId}/upload': + '/v1/asset/{assetId}/upload': parameters: - name: assetId in: path From 2b9a0d76eed3781a1a4f04d95751f6a4ef913a19 Mon Sep 17 00:00:00 2001 From: Tomas Casas Date: Thu, 28 Nov 2024 15:25:47 -0300 Subject: [PATCH 13/30] Add description to file property --- management/asset.yaml | 1 + management/openapi-3.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/management/asset.yaml b/management/asset.yaml index d7d8c5e..9c64efc 100644 --- a/management/asset.yaml +++ b/management/asset.yaml @@ -168,6 +168,7 @@ paths: file: type: string format: binary + description: This must be an image file responses: 200: description: Successfully Uploaded diff --git a/management/openapi-3.yaml b/management/openapi-3.yaml index 25a1c6d..9959869 100644 --- a/management/openapi-3.yaml +++ b/management/openapi-3.yaml @@ -2283,6 +2283,7 @@ paths: file: type: string format: binary + description: This must be an image file responses: 200: description: Successfully Uploaded From d30f12b55195f4418ee2336099292f0f1560c65a Mon Sep 17 00:00:00 2001 From: Tomas Casas Date: Thu, 28 Nov 2024 15:28:22 -0300 Subject: [PATCH 14/30] Reshape Asset based Status value --- management/schemas/asset.yaml | 47 +++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/management/schemas/asset.yaml b/management/schemas/asset.yaml index 4a12d6f..e2a24b3 100644 --- a/management/schemas/asset.yaml +++ b/management/schemas/asset.yaml @@ -10,21 +10,23 @@ schemas: Type: type: string enum: ['video', 'image'] - ContentURL: - type: string - format: uri - nullable: true AssetInput: - $ref: '#/schemas/AssetBase' + allOf: + - $ref: '#/schemas/AssetBase' + - type: object + properties: + ContentURL: + type: string + nullable: true + optional: true Asset: allOf: - - $ref: '#/schemas/AssetBase' + - $ref: '#/schemas/AdBase' - type: object required: - Id - - Status - AdvertiserId properties: AdvertiserId: @@ -35,15 +37,34 @@ schemas: type: integer format: int32 nullable: true - Status: - type: string - UploadURL: - type: string - format: uri - nullable: true IsDeleted: type: boolean nullable: true + - oneOf: + - type: object + required: + - Status + - UploadURL + properties: + Status: + type: string + enum: ['pending'] + UploadURL: + type: string + format: uri + nullable: true + - type: object + required: + - Status + - ContentURL + properties: + Status: + type: string + enum: ['ready'] + ContentURL: + type: string + format: uri + nullable: true AssetDetails: allOf: From b35e7ba4272d057ed75bd3a24c88215f5b7ba442 Mon Sep 17 00:00:00 2001 From: Tomas Casas Date: Mon, 2 Dec 2024 10:13:43 -0300 Subject: [PATCH 15/30] Specialize Job params by TaskId --- management/schemas/job.yaml | 103 +++++++++++++++++++----------------- 1 file changed, 54 insertions(+), 49 deletions(-) diff --git a/management/schemas/job.yaml b/management/schemas/job.yaml index 183dcc4..f07fcd4 100644 --- a/management/schemas/job.yaml +++ b/management/schemas/job.yaml @@ -12,38 +12,42 @@ schemas: type: string enum: ['op', 'literal', 'stringify', 'stringify-array'] - Task: + CreateAdsFromProductsTask: type: object properties: - ProductUris: - type: array - items: - type: string - format: uri - AdTemplateUri: + TaskId: type: string - format: uri - FlightId: - type: integer - format: int32 - Overrides: + enum: ['create-ads-from-products'] + TaskArgs: type: object - description: 'A map or ProductUri keys with Override values' - additionalProperties: - $ref: '#/schemas/Override' + properties: + ProductUris: + type: array + items: + type: string + format: uri + AdTemplateUri: + type: string + format: uri + FlightId: + type: integer + format: int32 + Overrides: + type: object + description: 'A map or ProductUri keys with Override values' + additionalProperties: + $ref: '#/schemas/Override' JobInput: - type: object - required: - - TaskId - properties: - TaskId: - type: string - maxLength: 100 - TaskArgs: - $ref: '#/schemas/Task' - PartitionId: - type: string + allOf: + - oneOf: + - $ref: '#/schemas/CreateAdsFromProductsTask' + - type: object + required: + - TaskId + properties: + PartitionId: + type: string SuccessfulOutput: type: object @@ -85,29 +89,30 @@ schemas: type: string Job: - type: object - required: - - TaskId - properties: - CompletedTime: - type: string - NetworkId: - type: integer - Status: - type: string - TaskArgs: - $ref: '#/schemas/Task' - AvailableTime: - type: string - Output: - type: object - anyOf: - - $ref: '#/schemas/CompletedOutput' - - $ref: '#/schemas/FailedOutput' - Id: - type: integer - PartitionId: - type: string + allOf: + - oneOf: + - $ref: '#/schemas/CreateAdsFromProductsTask' + - type: object + required: + - TaskId + properties: + CompletedTime: + type: string + NetworkId: + type: integer + Status: + type: string + AvailableTime: + type: string + Output: + type: object + anyOf: + - $ref: '#/schemas/CompletedOutput' + - $ref: '#/schemas/FailedOutput' + Id: + type: integer + PartitionId: + type: string JobList: type: object From 1cff4a7108452e0c3eafbcc4e129fe36dc2e4206 Mon Sep 17 00:00:00 2001 From: Tomas Casas Date: Mon, 2 Dec 2024 10:56:46 -0300 Subject: [PATCH 16/30] Fix type casing and op enum values --- management/schemas/job.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/management/schemas/job.yaml b/management/schemas/job.yaml index f07fcd4..985a8f1 100644 --- a/management/schemas/job.yaml +++ b/management/schemas/job.yaml @@ -1,6 +1,6 @@ schemas: Override: - type: Object + type: object properties: source: type: string @@ -10,7 +10,7 @@ schemas: type: string op: type: string - enum: ['op', 'literal', 'stringify', 'stringify-array'] + enum: ['constant', 'literal', 'stringify', 'stringify-array'] CreateAdsFromProductsTask: type: object @@ -34,7 +34,7 @@ schemas: format: int32 Overrides: type: object - description: 'A map or ProductUri keys with Override values' + description: 'A map of ProductUri keys with Override values' additionalProperties: $ref: '#/schemas/Override' From dcf6d8ff218fa8621385c05f2e11a13c5ac17c89 Mon Sep 17 00:00:00 2001 From: Tomas Casas Date: Tue, 3 Dec 2024 10:14:10 -0300 Subject: [PATCH 17/30] Fix NextedFlightOutput ref to Job --- management/schemas/flight.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/management/schemas/flight.yaml b/management/schemas/flight.yaml index 292f66d..4e4e68b 100644 --- a/management/schemas/flight.yaml +++ b/management/schemas/flight.yaml @@ -364,4 +364,4 @@ schemas: Jobs: type: array items: - $ref: './job.yaml#/schemas/JobOutput' + $ref: './job.yaml#/schemas/Job' From e8d9c2cc62a9b6c04bc5d9f5f6118db0bafb3610 Mon Sep 17 00:00:00 2001 From: Tomas Casas Date: Tue, 3 Dec 2024 10:18:59 -0300 Subject: [PATCH 18/30] Rename Base* to *Base for consistency --- management/schemas/ad.yaml | 2 +- management/schemas/asset.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/management/schemas/ad.yaml b/management/schemas/ad.yaml index 352069e..9c19500 100644 --- a/management/schemas/ad.yaml +++ b/management/schemas/ad.yaml @@ -1,5 +1,5 @@ schemas: - BaseAd: + AdBase: type: object required: - Creative diff --git a/management/schemas/asset.yaml b/management/schemas/asset.yaml index e2a24b3..4f17b77 100644 --- a/management/schemas/asset.yaml +++ b/management/schemas/asset.yaml @@ -1,5 +1,5 @@ schemas: - BaseAsset: + AssetBase: type: object required: - Name @@ -23,7 +23,7 @@ schemas: Asset: allOf: - - $ref: '#/schemas/AdBase' + - $ref: '#/schemas/AssetBase' - type: object required: - Id From 010e84e839bd90e28993e0bfee9f70b61296b83c Mon Sep 17 00:00:00 2001 From: Tomas Casas Date: Tue, 3 Dec 2024 10:27:10 -0300 Subject: [PATCH 19/30] Use generic description for generic params --- management/asset.yaml | 6 +++--- management/openapi-3.yaml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/management/asset.yaml b/management/asset.yaml index 9c64efc..b0af3e0 100644 --- a/management/asset.yaml +++ b/management/asset.yaml @@ -45,7 +45,7 @@ paths: parameters: - name: assetId in: path - description: Id of the Asset to get + description: Id of the Asset required: true schema: type: integer @@ -127,7 +127,7 @@ paths: parameters: - name: assetId in: path - description: Id of the Asset to delete + description: Id of the Asset required: true schema: type: integer @@ -146,7 +146,7 @@ paths: parameters: - name: assetId in: path - description: Id of the Asset to delete + description: Id of the Asset required: true schema: type: integer diff --git a/management/openapi-3.yaml b/management/openapi-3.yaml index 9959869..bd818f9 100644 --- a/management/openapi-3.yaml +++ b/management/openapi-3.yaml @@ -2160,7 +2160,7 @@ paths: parameters: - name: assetId in: path - description: Id of the Asset to get + description: Id of the Asset required: true schema: type: integer @@ -2242,7 +2242,7 @@ paths: parameters: - name: assetId in: path - description: Id of the Asset to delete + description: Id of the Asset required: true schema: type: integer @@ -2261,7 +2261,7 @@ paths: parameters: - name: assetId in: path - description: Id of the Asset to delete + description: Id of the Asset required: true schema: type: integer From 84d823043d80b59126bdb9e8425ae95c39dcdb52 Mon Sep 17 00:00:00 2001 From: Tomas Casas Date: Tue, 3 Dec 2024 10:27:28 -0300 Subject: [PATCH 20/30] Rephrase asset upload description --- management/asset.yaml | 2 +- management/openapi-3.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/management/asset.yaml b/management/asset.yaml index b0af3e0..4650786 100644 --- a/management/asset.yaml +++ b/management/asset.yaml @@ -154,7 +154,7 @@ paths: post: tags: - assets - description: Upload an existing Asset Content + description: Upload content to an existing Asset operationId: uploadAssetContent security: - ApiKeyAuth: [] diff --git a/management/openapi-3.yaml b/management/openapi-3.yaml index bd818f9..cde49e8 100644 --- a/management/openapi-3.yaml +++ b/management/openapi-3.yaml @@ -2269,7 +2269,7 @@ paths: post: tags: - assets - description: Upload an existing Asset Content + description: Upload content to an existing Asset operationId: uploadAssetContent security: - ApiKeyAuth: [] From 5498ef4b38c141d69e1c719411475613af17e851 Mon Sep 17 00:00:00 2001 From: Tomas Casas Date: Tue, 3 Dec 2024 10:33:21 -0300 Subject: [PATCH 21/30] Fix /v1/job/{jobId} description and opId --- management/job.yaml | 4 ++-- management/openapi-3.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/management/job.yaml b/management/job.yaml index e8e2588..9243e5f 100644 --- a/management/job.yaml +++ b/management/job.yaml @@ -13,8 +13,8 @@ paths: get: tags: - jobs - description: List Jobs - operationId: listJobs + description: Get Job + operationId: getJob security: - ApiKeyAuth: [] parameters: diff --git a/management/openapi-3.yaml b/management/openapi-3.yaml index cde49e8..2d457a0 100644 --- a/management/openapi-3.yaml +++ b/management/openapi-3.yaml @@ -2042,8 +2042,8 @@ paths: get: tags: - jobs - description: List Jobs - operationId: listJobs + description: Get Job + operationId: getJob security: - ApiKeyAuth: [] parameters: From 97b5b412441e337371e8419bafc3145f78235f74 Mon Sep 17 00:00:00 2001 From: Tomas Casas Date: Tue, 3 Dec 2024 10:36:35 -0300 Subject: [PATCH 22/30] Update /v1/job/{jobId} response description --- management/job.yaml | 2 +- management/openapi-3.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/management/job.yaml b/management/job.yaml index 9243e5f..423ee25 100644 --- a/management/job.yaml +++ b/management/job.yaml @@ -33,7 +33,7 @@ paths: type: boolean responses: 200: - description: The existing Job + description: The specified Job content: application/json: schema: diff --git a/management/openapi-3.yaml b/management/openapi-3.yaml index 2d457a0..f42f6f0 100644 --- a/management/openapi-3.yaml +++ b/management/openapi-3.yaml @@ -2062,7 +2062,7 @@ paths: type: boolean responses: 200: - description: The existing Job + description: The specified Job content: application/json: schema: From 9d2aec21679d5df2fb308e55b9e88a77acc7a266 Mon Sep 17 00:00:00 2001 From: Tomas Casas Date: Tue, 3 Dec 2024 10:38:46 -0300 Subject: [PATCH 23/30] Fix /v1/job post response description --- management/job.yaml | 2 +- management/openapi-3.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/management/job.yaml b/management/job.yaml index 423ee25..1bc1163 100644 --- a/management/job.yaml +++ b/management/job.yaml @@ -90,7 +90,7 @@ paths: $ref: './schemas/job.yaml#/schemas/JobInput' responses: 200: - description: Advertiser Created + description: Job Created content: application/json: schema: diff --git a/management/openapi-3.yaml b/management/openapi-3.yaml index f42f6f0..e5135b6 100644 --- a/management/openapi-3.yaml +++ b/management/openapi-3.yaml @@ -2119,7 +2119,7 @@ paths: $ref: './schemas/job.yaml#/schemas/JobInput' responses: 200: - description: Advertiser Created + description: Job Created content: application/json: schema: From c06e8e751e76bd1113338b49044aa7b488616d76 Mon Sep 17 00:00:00 2001 From: Tomas Casas Date: Tue, 3 Dec 2024 10:41:47 -0300 Subject: [PATCH 24/30] Update description to single asset creation --- management/asset.yaml | 2 +- management/openapi-3.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/management/asset.yaml b/management/asset.yaml index 4650786..2dc07ab 100644 --- a/management/asset.yaml +++ b/management/asset.yaml @@ -107,7 +107,7 @@ paths: post: tags: - assets - description: Create Assets + description: Create Asset operationId: createAsset security: - ApiKeyAuth: [] diff --git a/management/openapi-3.yaml b/management/openapi-3.yaml index e5135b6..8db98a5 100644 --- a/management/openapi-3.yaml +++ b/management/openapi-3.yaml @@ -2222,7 +2222,7 @@ paths: post: tags: - assets - description: Create Assets + description: Create Asset operationId: createAsset security: - ApiKeyAuth: [] From f6a0a932ddcd0d362f2569af1d3cb57a7238fb37 Mon Sep 17 00:00:00 2001 From: Tomas Casas Date: Tue, 3 Dec 2024 16:20:53 -0300 Subject: [PATCH 25/30] Add missing asset upload query params --- management/asset.yaml | 14 ++++++++++++++ management/openapi-3.yaml | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/management/asset.yaml b/management/asset.yaml index 2dc07ab..c265f6e 100644 --- a/management/asset.yaml +++ b/management/asset.yaml @@ -158,6 +158,20 @@ paths: operationId: uploadAssetContent security: - ApiKeyAuth: [] + parameters: + - name: timestamp + in: query + description: Milliseconds since epoch from asset creation + required: true + schema: + type: integer + format: int32 + - name: signature + in: query + description: Signing hash from asset creation + required: true + schema: + type: string requestBody: required: true content: diff --git a/management/openapi-3.yaml b/management/openapi-3.yaml index 8db98a5..8886f96 100644 --- a/management/openapi-3.yaml +++ b/management/openapi-3.yaml @@ -2273,6 +2273,20 @@ paths: operationId: uploadAssetContent security: - ApiKeyAuth: [] + parameters: + - name: timestamp + in: query + description: Milliseconds since epoch from asset creation + required: true + schema: + type: integer + format: int32 + - name: signature + in: query + description: Signing hash from asset creation + required: true + schema: + type: string requestBody: required: true content: From 936c85ae3d1d5c1bb02777838f93b9b09519aeaf Mon Sep 17 00:00:00 2001 From: Tomas Casas Date: Wed, 4 Dec 2024 14:26:07 -0300 Subject: [PATCH 26/30] Create CampaignInput schema --- management/schemas/campaign.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/management/schemas/campaign.yaml b/management/schemas/campaign.yaml index c2c0cba..22c25d8 100644 --- a/management/schemas/campaign.yaml +++ b/management/schemas/campaign.yaml @@ -63,6 +63,17 @@ schemas: nullable: true readOnly: true + CampaignInput: + allOf: + - $ref: '#/schemas/CampaignBase' + - type: object + properties: + Flights: + type: array + items: + type: object + nullable: true + Campaign: allOf: - $ref: '#/schemas/CampaignBase' From ad4e6d6b727b571dde56d6062939b4331ff04149 Mon Sep 17 00:00:00 2001 From: Tomas Casas Date: Wed, 4 Dec 2024 14:26:29 -0300 Subject: [PATCH 27/30] Restore required Campaign.Id for output --- management/schemas/campaign.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/management/schemas/campaign.yaml b/management/schemas/campaign.yaml index 22c25d8..16c9d4a 100644 --- a/management/schemas/campaign.yaml +++ b/management/schemas/campaign.yaml @@ -79,6 +79,8 @@ schemas: - $ref: '#/schemas/CampaignBase' - type: object properties: + required: + - Id Id: type: integer format: int32 From ec81492bd6b4ab4f447821fee3aa632ac37d653f Mon Sep 17 00:00:00 2001 From: Tomas Casas Date: Wed, 4 Dec 2024 14:27:11 -0300 Subject: [PATCH 28/30] Uniform object props order --- management/schemas/campaign.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/management/schemas/campaign.yaml b/management/schemas/campaign.yaml index 16c9d4a..bff34b8 100644 --- a/management/schemas/campaign.yaml +++ b/management/schemas/campaign.yaml @@ -101,14 +101,14 @@ schemas: readOnly: true EndDate: type: string + deprecated: true nullable: true readOnly: true - deprecated: true EndDateISO: type: string - readOnly: true deprecated: true nullable: true + readOnly: true Price: type: number deprecated: true From cc8e00bf571f3dd62d97155feb39fca298162acf Mon Sep 17 00:00:00 2001 From: Tomas Casas Date: Wed, 4 Dec 2024 14:27:35 -0300 Subject: [PATCH 29/30] Use CampaignInput schema for /v1/campaign --- management/campaign.yaml | 2 +- management/openapi-3.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/management/campaign.yaml b/management/campaign.yaml index 4fda3e1..52949d8 100644 --- a/management/campaign.yaml +++ b/management/campaign.yaml @@ -41,7 +41,7 @@ paths: content: application/json: schema: - $ref: './schemas/campaign.yaml#/schemas/Campaign' + $ref: './schemas/campaign.yaml#/schemas/CampaignInput' responses: 200: description: Campaign Created diff --git a/management/openapi-3.yaml b/management/openapi-3.yaml index 90f4d69..116d306 100644 --- a/management/openapi-3.yaml +++ b/management/openapi-3.yaml @@ -207,7 +207,7 @@ paths: content: application/json: schema: - $ref: './schemas/campaign.yaml#/schemas/Campaign' + $ref: './schemas/campaign.yaml#/schemas/CampaignInput' responses: 200: description: Campaign Created From b78b722246e3e1f32fbd90011b8553dda2dfb8ca Mon Sep 17 00:00:00 2001 From: Tomas Casas Date: Wed, 4 Dec 2024 14:38:36 -0300 Subject: [PATCH 30/30] Move required Campaign.Id where appropriate --- management/schemas/campaign.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/management/schemas/campaign.yaml b/management/schemas/campaign.yaml index bff34b8..4d54f4b 100644 --- a/management/schemas/campaign.yaml +++ b/management/schemas/campaign.yaml @@ -78,9 +78,9 @@ schemas: allOf: - $ref: '#/schemas/CampaignBase' - type: object + required: + - Id properties: - required: - - Id Id: type: integer format: int32