From d02bcaa64fa2ca36553e28aee2b3eac5a8a4d17d Mon Sep 17 00:00:00 2001 From: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Sun, 25 Aug 2024 11:30:07 -0700 Subject: [PATCH] Make certain props in feature links nullable (#4281) * make certain props in feature links nullable * update openapi models * update TS type def for FeatureLink * remove information and http_error_code required * Use LinkPreview instead of LinkPreviewBase * information set to optional --- api/feature_links_api.py | 2 +- client-src/js-src/cs-client.js | 4 ++-- .../src/models/FeatureLinksResponse.ts | 18 ++++++++-------- .../src/models/FeatureLinksSample.ts | 10 ++++----- .../src/models/LinkPreview.ts | 10 ++++----- .../src/models/LinkPreviewBase.ts | 10 ++++----- .../src/models/LinkPreviewGithubIssue.ts | 10 ++++----- .../src/models/LinkPreviewGithubMarkdown.ts | 10 ++++----- .../models/LinkPreviewGithubPullRequest.ts | 10 ++++----- .../src/models/LinkPreviewGoogleDocs.ts | 10 ++++----- .../src/models/LinkPreviewMdnDocs.ts | 10 ++++----- .../src/models/LinkPreviewMozillaBug.ts | 10 ++++----- .../src/models/LinkPreviewOpenGraph.ts | 10 ++++----- .../src/models/LinkPreviewSpecs.ts | 10 ++++----- .../src/models/LinkPreviewWebkitBug.ts | 10 ++++----- .../models/feature_links_response.py | 16 +++++++------- .../models/feature_links_sample.py | 4 ---- .../models/link_preview.py | 4 ---- .../models/link_preview_base.py | 4 ---- .../models/link_preview_github_issue.py | 4 ---- .../models/link_preview_github_markdown.py | 4 ---- .../link_preview_github_pull_request.py | 4 ---- .../models/link_preview_google_docs.py | 4 ---- .../models/link_preview_mdn_docs.py | 4 ---- .../models/link_preview_mozilla_bug.py | 4 ---- .../models/link_preview_open_graph.py | 4 ---- .../models/link_preview_specs.py | 4 ---- .../models/link_preview_webkit_bug.py | 4 ---- .../chromestatus_openapi/openapi/openapi.yaml | 21 +++++-------------- openapi/api.yaml | 9 +++----- 30 files changed, 76 insertions(+), 162 deletions(-) diff --git a/api/feature_links_api.py b/api/feature_links_api.py index 9dd66fd3..a69f2eec 100644 --- a/api/feature_links_api.py +++ b/api/feature_links_api.py @@ -69,4 +69,4 @@ class FeatureLinksSamplesAPI(basehandlers.APIHandler): type = self.request.args.get('type', None) is_error = self.get_bool_arg('is_error', None) if domain: - return FeatureLinksSample.from_dict(get_feature_links_samples(domain, type, is_error)) \ No newline at end of file + return FeatureLinksSample.from_dict(get_feature_links_samples(domain, type, is_error)) diff --git a/client-src/js-src/cs-client.js b/client-src/js-src/cs-client.js index 8603b8a7..83ff3604 100644 --- a/client-src/js-src/cs-client.js +++ b/client-src/js-src/cs-client.js @@ -18,8 +18,8 @@ * @typedef {object} FeatureLink * @property {string} url * @property {string} type - * @property {object} information - fields depend on type; see link_helpers.py - * @property {number} http_error_code + * @property {object} [information] - fields depend on type; see link_helpers.py + * @property {number | null} [http_error_code] */ /** diff --git a/gen/js/chromestatus-openapi/src/models/FeatureLinksResponse.ts b/gen/js/chromestatus-openapi/src/models/FeatureLinksResponse.ts index b38812b9..03578b27 100644 --- a/gen/js/chromestatus-openapi/src/models/FeatureLinksResponse.ts +++ b/gen/js/chromestatus-openapi/src/models/FeatureLinksResponse.ts @@ -13,12 +13,12 @@ */ import { mapValues } from '../runtime'; -import type { LinkPreviewBase } from './LinkPreviewBase'; +import type { LinkPreview } from './LinkPreview'; import { - LinkPreviewBaseFromJSON, - LinkPreviewBaseFromJSONTyped, - LinkPreviewBaseToJSON, -} from './LinkPreviewBase'; + LinkPreviewFromJSON, + LinkPreviewFromJSONTyped, + LinkPreviewToJSON, +} from './LinkPreview'; /** * @@ -28,10 +28,10 @@ import { export interface FeatureLinksResponse { /** * - * @type {Array} + * @type {Array} * @memberof FeatureLinksResponse */ - data?: Array; + data?: Array; /** * * @type {boolean} @@ -57,7 +57,7 @@ export function FeatureLinksResponseFromJSONTyped(json: any, ignoreDiscriminator } return { - 'data': json['data'] == null ? undefined : ((json['data'] as Array).map(LinkPreviewBaseFromJSON)), + 'data': json['data'] == null ? undefined : ((json['data'] as Array).map(LinkPreviewFromJSON)), 'has_stale_links': json['has_stale_links'] == null ? undefined : json['has_stale_links'], }; } @@ -68,7 +68,7 @@ export function FeatureLinksResponseToJSON(value?: FeatureLinksResponse | null): } return { - 'data': value['data'] == null ? undefined : ((value['data'] as Array).map(LinkPreviewBaseToJSON)), + 'data': value['data'] == null ? undefined : ((value['data'] as Array).map(LinkPreviewToJSON)), 'has_stale_links': value['has_stale_links'], }; } diff --git a/gen/js/chromestatus-openapi/src/models/FeatureLinksSample.ts b/gen/js/chromestatus-openapi/src/models/FeatureLinksSample.ts index 3bff6b1b..730cc369 100644 --- a/gen/js/chromestatus-openapi/src/models/FeatureLinksSample.ts +++ b/gen/js/chromestatus-openapi/src/models/FeatureLinksSample.ts @@ -36,13 +36,13 @@ export interface FeatureLinksSample { * @type {object} * @memberof FeatureLinksSample */ - information: object; + information?: object; /** * * @type {number} * @memberof FeatureLinksSample */ - http_error_code: number; + http_error_code?: number; /** * * @type {Array} @@ -57,8 +57,6 @@ export interface FeatureLinksSample { export function instanceOfFeatureLinksSample(value: object): value is FeatureLinksSample { if (!('url' in value) || value['url'] === undefined) return false; if (!('type' in value) || value['type'] === undefined) return false; - if (!('information' in value) || value['information'] === undefined) return false; - if (!('http_error_code' in value) || value['http_error_code'] === undefined) return false; return true; } @@ -74,8 +72,8 @@ export function FeatureLinksSampleFromJSONTyped(json: any, ignoreDiscriminator: 'url': json['url'], 'type': json['type'], - 'information': json['information'], - 'http_error_code': json['http_error_code'], + 'information': json['information'] == null ? undefined : json['information'], + 'http_error_code': json['http_error_code'] == null ? undefined : json['http_error_code'], 'feature_ids': json['feature_ids'] == null ? undefined : json['feature_ids'], }; } diff --git a/gen/js/chromestatus-openapi/src/models/LinkPreview.ts b/gen/js/chromestatus-openapi/src/models/LinkPreview.ts index 0a8e46e8..17414db8 100644 --- a/gen/js/chromestatus-openapi/src/models/LinkPreview.ts +++ b/gen/js/chromestatus-openapi/src/models/LinkPreview.ts @@ -44,13 +44,13 @@ export interface LinkPreview { * @type {object} * @memberof LinkPreview */ - information: object; + information?: object; /** * * @type {number} * @memberof LinkPreview */ - http_error_code: number; + http_error_code?: number; } /** @@ -59,8 +59,6 @@ export interface LinkPreview { export function instanceOfLinkPreview(value: object): value is LinkPreview { if (!('url' in value) || value['url'] === undefined) return false; if (!('type' in value) || value['type'] === undefined) return false; - if (!('information' in value) || value['information'] === undefined) return false; - if (!('http_error_code' in value) || value['http_error_code'] === undefined) return false; return true; } @@ -102,8 +100,8 @@ export function LinkPreviewFromJSONTyped(json: any, ignoreDiscriminator: boolean 'url': json['url'], 'type': json['type'], - 'information': json['information'], - 'http_error_code': json['http_error_code'], + 'information': json['information'] == null ? undefined : json['information'], + 'http_error_code': json['http_error_code'] == null ? undefined : json['http_error_code'], }; } diff --git a/gen/js/chromestatus-openapi/src/models/LinkPreviewBase.ts b/gen/js/chromestatus-openapi/src/models/LinkPreviewBase.ts index 56f576de..18b9fb91 100644 --- a/gen/js/chromestatus-openapi/src/models/LinkPreviewBase.ts +++ b/gen/js/chromestatus-openapi/src/models/LinkPreviewBase.ts @@ -36,13 +36,13 @@ export interface LinkPreviewBase { * @type {object} * @memberof LinkPreviewBase */ - information: object; + information?: object; /** * * @type {number} * @memberof LinkPreviewBase */ - http_error_code: number; + http_error_code?: number; } /** @@ -51,8 +51,6 @@ export interface LinkPreviewBase { export function instanceOfLinkPreviewBase(value: object): value is LinkPreviewBase { if (!('url' in value) || value['url'] === undefined) return false; if (!('type' in value) || value['type'] === undefined) return false; - if (!('information' in value) || value['information'] === undefined) return false; - if (!('http_error_code' in value) || value['http_error_code'] === undefined) return false; return true; } @@ -68,8 +66,8 @@ export function LinkPreviewBaseFromJSONTyped(json: any, ignoreDiscriminator: boo 'url': json['url'], 'type': json['type'], - 'information': json['information'], - 'http_error_code': json['http_error_code'], + 'information': json['information'] == null ? undefined : json['information'], + 'http_error_code': json['http_error_code'] == null ? undefined : json['http_error_code'], }; } diff --git a/gen/js/chromestatus-openapi/src/models/LinkPreviewGithubIssue.ts b/gen/js/chromestatus-openapi/src/models/LinkPreviewGithubIssue.ts index 025b4e1a..5f8cf7d8 100644 --- a/gen/js/chromestatus-openapi/src/models/LinkPreviewGithubIssue.ts +++ b/gen/js/chromestatus-openapi/src/models/LinkPreviewGithubIssue.ts @@ -43,13 +43,13 @@ export interface LinkPreviewGithubIssue { * @type {LinkPreviewGithubIssueAllOfInformation} * @memberof LinkPreviewGithubIssue */ - information: LinkPreviewGithubIssueAllOfInformation; + information?: LinkPreviewGithubIssueAllOfInformation; /** * * @type {number} * @memberof LinkPreviewGithubIssue */ - http_error_code: number; + http_error_code?: number; } /** @@ -58,8 +58,6 @@ export interface LinkPreviewGithubIssue { export function instanceOfLinkPreviewGithubIssue(value: object): value is LinkPreviewGithubIssue { if (!('url' in value) || value['url'] === undefined) return false; if (!('type' in value) || value['type'] === undefined) return false; - if (!('information' in value) || value['information'] === undefined) return false; - if (!('http_error_code' in value) || value['http_error_code'] === undefined) return false; return true; } @@ -75,8 +73,8 @@ export function LinkPreviewGithubIssueFromJSONTyped(json: any, ignoreDiscriminat 'url': json['url'], 'type': json['type'], - 'information': LinkPreviewGithubIssueAllOfInformationFromJSON(json['information']), - 'http_error_code': json['http_error_code'], + 'information': json['information'] == null ? undefined : LinkPreviewGithubIssueAllOfInformationFromJSON(json['information']), + 'http_error_code': json['http_error_code'] == null ? undefined : json['http_error_code'], }; } diff --git a/gen/js/chromestatus-openapi/src/models/LinkPreviewGithubMarkdown.ts b/gen/js/chromestatus-openapi/src/models/LinkPreviewGithubMarkdown.ts index 2c0b77c5..6e4f5f16 100644 --- a/gen/js/chromestatus-openapi/src/models/LinkPreviewGithubMarkdown.ts +++ b/gen/js/chromestatus-openapi/src/models/LinkPreviewGithubMarkdown.ts @@ -43,13 +43,13 @@ export interface LinkPreviewGithubMarkdown { * @type {LinkPreviewGithubMarkdownAllOfInformation} * @memberof LinkPreviewGithubMarkdown */ - information: LinkPreviewGithubMarkdownAllOfInformation; + information?: LinkPreviewGithubMarkdownAllOfInformation; /** * * @type {number} * @memberof LinkPreviewGithubMarkdown */ - http_error_code: number; + http_error_code?: number; } /** @@ -58,8 +58,6 @@ export interface LinkPreviewGithubMarkdown { export function instanceOfLinkPreviewGithubMarkdown(value: object): value is LinkPreviewGithubMarkdown { if (!('url' in value) || value['url'] === undefined) return false; if (!('type' in value) || value['type'] === undefined) return false; - if (!('information' in value) || value['information'] === undefined) return false; - if (!('http_error_code' in value) || value['http_error_code'] === undefined) return false; return true; } @@ -75,8 +73,8 @@ export function LinkPreviewGithubMarkdownFromJSONTyped(json: any, ignoreDiscrimi 'url': json['url'], 'type': json['type'], - 'information': LinkPreviewGithubMarkdownAllOfInformationFromJSON(json['information']), - 'http_error_code': json['http_error_code'], + 'information': json['information'] == null ? undefined : LinkPreviewGithubMarkdownAllOfInformationFromJSON(json['information']), + 'http_error_code': json['http_error_code'] == null ? undefined : json['http_error_code'], }; } diff --git a/gen/js/chromestatus-openapi/src/models/LinkPreviewGithubPullRequest.ts b/gen/js/chromestatus-openapi/src/models/LinkPreviewGithubPullRequest.ts index 2dab4245..d48d10cc 100644 --- a/gen/js/chromestatus-openapi/src/models/LinkPreviewGithubPullRequest.ts +++ b/gen/js/chromestatus-openapi/src/models/LinkPreviewGithubPullRequest.ts @@ -43,13 +43,13 @@ export interface LinkPreviewGithubPullRequest { * @type {LinkPreviewGithubIssueAllOfInformation} * @memberof LinkPreviewGithubPullRequest */ - information: LinkPreviewGithubIssueAllOfInformation; + information?: LinkPreviewGithubIssueAllOfInformation; /** * * @type {number} * @memberof LinkPreviewGithubPullRequest */ - http_error_code: number; + http_error_code?: number; } /** @@ -58,8 +58,6 @@ export interface LinkPreviewGithubPullRequest { export function instanceOfLinkPreviewGithubPullRequest(value: object): value is LinkPreviewGithubPullRequest { if (!('url' in value) || value['url'] === undefined) return false; if (!('type' in value) || value['type'] === undefined) return false; - if (!('information' in value) || value['information'] === undefined) return false; - if (!('http_error_code' in value) || value['http_error_code'] === undefined) return false; return true; } @@ -75,8 +73,8 @@ export function LinkPreviewGithubPullRequestFromJSONTyped(json: any, ignoreDiscr 'url': json['url'], 'type': json['type'], - 'information': LinkPreviewGithubIssueAllOfInformationFromJSON(json['information']), - 'http_error_code': json['http_error_code'], + 'information': json['information'] == null ? undefined : LinkPreviewGithubIssueAllOfInformationFromJSON(json['information']), + 'http_error_code': json['http_error_code'] == null ? undefined : json['http_error_code'], }; } diff --git a/gen/js/chromestatus-openapi/src/models/LinkPreviewGoogleDocs.ts b/gen/js/chromestatus-openapi/src/models/LinkPreviewGoogleDocs.ts index 0ed2898c..b2e19455 100644 --- a/gen/js/chromestatus-openapi/src/models/LinkPreviewGoogleDocs.ts +++ b/gen/js/chromestatus-openapi/src/models/LinkPreviewGoogleDocs.ts @@ -43,13 +43,13 @@ export interface LinkPreviewGoogleDocs { * @type {LinkPreviewOpenGraphAllOfInformation} * @memberof LinkPreviewGoogleDocs */ - information: LinkPreviewOpenGraphAllOfInformation; + information?: LinkPreviewOpenGraphAllOfInformation; /** * * @type {number} * @memberof LinkPreviewGoogleDocs */ - http_error_code: number; + http_error_code?: number; } /** @@ -58,8 +58,6 @@ export interface LinkPreviewGoogleDocs { export function instanceOfLinkPreviewGoogleDocs(value: object): value is LinkPreviewGoogleDocs { if (!('url' in value) || value['url'] === undefined) return false; if (!('type' in value) || value['type'] === undefined) return false; - if (!('information' in value) || value['information'] === undefined) return false; - if (!('http_error_code' in value) || value['http_error_code'] === undefined) return false; return true; } @@ -75,8 +73,8 @@ export function LinkPreviewGoogleDocsFromJSONTyped(json: any, ignoreDiscriminato 'url': json['url'], 'type': json['type'], - 'information': LinkPreviewOpenGraphAllOfInformationFromJSON(json['information']), - 'http_error_code': json['http_error_code'], + 'information': json['information'] == null ? undefined : LinkPreviewOpenGraphAllOfInformationFromJSON(json['information']), + 'http_error_code': json['http_error_code'] == null ? undefined : json['http_error_code'], }; } diff --git a/gen/js/chromestatus-openapi/src/models/LinkPreviewMdnDocs.ts b/gen/js/chromestatus-openapi/src/models/LinkPreviewMdnDocs.ts index 9a7dc285..94a373bc 100644 --- a/gen/js/chromestatus-openapi/src/models/LinkPreviewMdnDocs.ts +++ b/gen/js/chromestatus-openapi/src/models/LinkPreviewMdnDocs.ts @@ -43,13 +43,13 @@ export interface LinkPreviewMdnDocs { * @type {LinkPreviewOpenGraphAllOfInformation} * @memberof LinkPreviewMdnDocs */ - information: LinkPreviewOpenGraphAllOfInformation; + information?: LinkPreviewOpenGraphAllOfInformation; /** * * @type {number} * @memberof LinkPreviewMdnDocs */ - http_error_code: number; + http_error_code?: number; } /** @@ -58,8 +58,6 @@ export interface LinkPreviewMdnDocs { export function instanceOfLinkPreviewMdnDocs(value: object): value is LinkPreviewMdnDocs { if (!('url' in value) || value['url'] === undefined) return false; if (!('type' in value) || value['type'] === undefined) return false; - if (!('information' in value) || value['information'] === undefined) return false; - if (!('http_error_code' in value) || value['http_error_code'] === undefined) return false; return true; } @@ -75,8 +73,8 @@ export function LinkPreviewMdnDocsFromJSONTyped(json: any, ignoreDiscriminator: 'url': json['url'], 'type': json['type'], - 'information': LinkPreviewOpenGraphAllOfInformationFromJSON(json['information']), - 'http_error_code': json['http_error_code'], + 'information': json['information'] == null ? undefined : LinkPreviewOpenGraphAllOfInformationFromJSON(json['information']), + 'http_error_code': json['http_error_code'] == null ? undefined : json['http_error_code'], }; } diff --git a/gen/js/chromestatus-openapi/src/models/LinkPreviewMozillaBug.ts b/gen/js/chromestatus-openapi/src/models/LinkPreviewMozillaBug.ts index 1eaac509..1deb09d3 100644 --- a/gen/js/chromestatus-openapi/src/models/LinkPreviewMozillaBug.ts +++ b/gen/js/chromestatus-openapi/src/models/LinkPreviewMozillaBug.ts @@ -43,13 +43,13 @@ export interface LinkPreviewMozillaBug { * @type {LinkPreviewOpenGraphAllOfInformation} * @memberof LinkPreviewMozillaBug */ - information: LinkPreviewOpenGraphAllOfInformation; + information?: LinkPreviewOpenGraphAllOfInformation; /** * * @type {number} * @memberof LinkPreviewMozillaBug */ - http_error_code: number; + http_error_code?: number; } /** @@ -58,8 +58,6 @@ export interface LinkPreviewMozillaBug { export function instanceOfLinkPreviewMozillaBug(value: object): value is LinkPreviewMozillaBug { if (!('url' in value) || value['url'] === undefined) return false; if (!('type' in value) || value['type'] === undefined) return false; - if (!('information' in value) || value['information'] === undefined) return false; - if (!('http_error_code' in value) || value['http_error_code'] === undefined) return false; return true; } @@ -75,8 +73,8 @@ export function LinkPreviewMozillaBugFromJSONTyped(json: any, ignoreDiscriminato 'url': json['url'], 'type': json['type'], - 'information': LinkPreviewOpenGraphAllOfInformationFromJSON(json['information']), - 'http_error_code': json['http_error_code'], + 'information': json['information'] == null ? undefined : LinkPreviewOpenGraphAllOfInformationFromJSON(json['information']), + 'http_error_code': json['http_error_code'] == null ? undefined : json['http_error_code'], }; } diff --git a/gen/js/chromestatus-openapi/src/models/LinkPreviewOpenGraph.ts b/gen/js/chromestatus-openapi/src/models/LinkPreviewOpenGraph.ts index 2437922f..64b88d05 100644 --- a/gen/js/chromestatus-openapi/src/models/LinkPreviewOpenGraph.ts +++ b/gen/js/chromestatus-openapi/src/models/LinkPreviewOpenGraph.ts @@ -43,13 +43,13 @@ export interface LinkPreviewOpenGraph { * @type {LinkPreviewOpenGraphAllOfInformation} * @memberof LinkPreviewOpenGraph */ - information: LinkPreviewOpenGraphAllOfInformation; + information?: LinkPreviewOpenGraphAllOfInformation; /** * * @type {number} * @memberof LinkPreviewOpenGraph */ - http_error_code: number; + http_error_code?: number; } /** @@ -58,8 +58,6 @@ export interface LinkPreviewOpenGraph { export function instanceOfLinkPreviewOpenGraph(value: object): value is LinkPreviewOpenGraph { if (!('url' in value) || value['url'] === undefined) return false; if (!('type' in value) || value['type'] === undefined) return false; - if (!('information' in value) || value['information'] === undefined) return false; - if (!('http_error_code' in value) || value['http_error_code'] === undefined) return false; return true; } @@ -75,8 +73,8 @@ export function LinkPreviewOpenGraphFromJSONTyped(json: any, ignoreDiscriminator 'url': json['url'], 'type': json['type'], - 'information': LinkPreviewOpenGraphAllOfInformationFromJSON(json['information']), - 'http_error_code': json['http_error_code'], + 'information': json['information'] == null ? undefined : LinkPreviewOpenGraphAllOfInformationFromJSON(json['information']), + 'http_error_code': json['http_error_code'] == null ? undefined : json['http_error_code'], }; } diff --git a/gen/js/chromestatus-openapi/src/models/LinkPreviewSpecs.ts b/gen/js/chromestatus-openapi/src/models/LinkPreviewSpecs.ts index 40715600..84ab2037 100644 --- a/gen/js/chromestatus-openapi/src/models/LinkPreviewSpecs.ts +++ b/gen/js/chromestatus-openapi/src/models/LinkPreviewSpecs.ts @@ -43,13 +43,13 @@ export interface LinkPreviewSpecs { * @type {LinkPreviewOpenGraphAllOfInformation} * @memberof LinkPreviewSpecs */ - information: LinkPreviewOpenGraphAllOfInformation; + information?: LinkPreviewOpenGraphAllOfInformation; /** * * @type {number} * @memberof LinkPreviewSpecs */ - http_error_code: number; + http_error_code?: number; } /** @@ -58,8 +58,6 @@ export interface LinkPreviewSpecs { export function instanceOfLinkPreviewSpecs(value: object): value is LinkPreviewSpecs { if (!('url' in value) || value['url'] === undefined) return false; if (!('type' in value) || value['type'] === undefined) return false; - if (!('information' in value) || value['information'] === undefined) return false; - if (!('http_error_code' in value) || value['http_error_code'] === undefined) return false; return true; } @@ -75,8 +73,8 @@ export function LinkPreviewSpecsFromJSONTyped(json: any, ignoreDiscriminator: bo 'url': json['url'], 'type': json['type'], - 'information': LinkPreviewOpenGraphAllOfInformationFromJSON(json['information']), - 'http_error_code': json['http_error_code'], + 'information': json['information'] == null ? undefined : LinkPreviewOpenGraphAllOfInformationFromJSON(json['information']), + 'http_error_code': json['http_error_code'] == null ? undefined : json['http_error_code'], }; } diff --git a/gen/js/chromestatus-openapi/src/models/LinkPreviewWebkitBug.ts b/gen/js/chromestatus-openapi/src/models/LinkPreviewWebkitBug.ts index c2a9f81d..9eee6dbb 100644 --- a/gen/js/chromestatus-openapi/src/models/LinkPreviewWebkitBug.ts +++ b/gen/js/chromestatus-openapi/src/models/LinkPreviewWebkitBug.ts @@ -43,13 +43,13 @@ export interface LinkPreviewWebkitBug { * @type {LinkPreviewOpenGraphAllOfInformation} * @memberof LinkPreviewWebkitBug */ - information: LinkPreviewOpenGraphAllOfInformation; + information?: LinkPreviewOpenGraphAllOfInformation; /** * * @type {number} * @memberof LinkPreviewWebkitBug */ - http_error_code: number; + http_error_code?: number; } /** @@ -58,8 +58,6 @@ export interface LinkPreviewWebkitBug { export function instanceOfLinkPreviewWebkitBug(value: object): value is LinkPreviewWebkitBug { if (!('url' in value) || value['url'] === undefined) return false; if (!('type' in value) || value['type'] === undefined) return false; - if (!('information' in value) || value['information'] === undefined) return false; - if (!('http_error_code' in value) || value['http_error_code'] === undefined) return false; return true; } @@ -75,8 +73,8 @@ export function LinkPreviewWebkitBugFromJSONTyped(json: any, ignoreDiscriminator 'url': json['url'], 'type': json['type'], - 'information': LinkPreviewOpenGraphAllOfInformationFromJSON(json['information']), - 'http_error_code': json['http_error_code'], + 'information': json['information'] == null ? undefined : LinkPreviewOpenGraphAllOfInformationFromJSON(json['information']), + 'http_error_code': json['http_error_code'] == null ? undefined : json['http_error_code'], }; } diff --git a/gen/py/chromestatus_openapi/chromestatus_openapi/models/feature_links_response.py b/gen/py/chromestatus_openapi/chromestatus_openapi/models/feature_links_response.py index 54f448b9..f1cd38c8 100644 --- a/gen/py/chromestatus_openapi/chromestatus_openapi/models/feature_links_response.py +++ b/gen/py/chromestatus_openapi/chromestatus_openapi/models/feature_links_response.py @@ -3,10 +3,10 @@ from datetime import date, datetime # noqa: F401 from typing import List, Dict # noqa: F401 from chromestatus_openapi.models.base_model import Model -from chromestatus_openapi.models.link_preview_base import LinkPreviewBase +from chromestatus_openapi.models.link_preview import LinkPreview from chromestatus_openapi import util -from chromestatus_openapi.models.link_preview_base import LinkPreviewBase # noqa: E501 +from chromestatus_openapi.models.link_preview import LinkPreview # noqa: E501 class FeatureLinksResponse(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,12 +18,12 @@ class FeatureLinksResponse(Model): """FeatureLinksResponse - a model defined in OpenAPI :param data: The data of this FeatureLinksResponse. # noqa: E501 - :type data: List[LinkPreviewBase] + :type data: List[LinkPreview] :param has_stale_links: The has_stale_links of this FeatureLinksResponse. # noqa: E501 :type has_stale_links: bool """ self.openapi_types = { - 'data': List[LinkPreviewBase], + 'data': List[LinkPreview], 'has_stale_links': bool } @@ -47,22 +47,22 @@ class FeatureLinksResponse(Model): return util.deserialize_model(dikt, cls) @property - def data(self) -> List[LinkPreviewBase]: + def data(self) -> List[LinkPreview]: """Gets the data of this FeatureLinksResponse. :return: The data of this FeatureLinksResponse. - :rtype: List[LinkPreviewBase] + :rtype: List[LinkPreview] """ return self._data @data.setter - def data(self, data: List[LinkPreviewBase]): + def data(self, data: List[LinkPreview]): """Sets the data of this FeatureLinksResponse. :param data: The data of this FeatureLinksResponse. - :type data: List[LinkPreviewBase] + :type data: List[LinkPreview] """ self._data = data diff --git a/gen/py/chromestatus_openapi/chromestatus_openapi/models/feature_links_sample.py b/gen/py/chromestatus_openapi/chromestatus_openapi/models/feature_links_sample.py index 4af69329..76e15b3f 100644 --- a/gen/py/chromestatus_openapi/chromestatus_openapi/models/feature_links_sample.py +++ b/gen/py/chromestatus_openapi/chromestatus_openapi/models/feature_links_sample.py @@ -123,8 +123,6 @@ class FeatureLinksSample(Model): :param information: The information of this FeatureLinksSample. :type information: object """ - if information is None: - raise ValueError("Invalid value for `information`, must not be `None`") # noqa: E501 self._information = information @@ -146,8 +144,6 @@ class FeatureLinksSample(Model): :param http_error_code: The http_error_code of this FeatureLinksSample. :type http_error_code: int """ - if http_error_code is None: - raise ValueError("Invalid value for `http_error_code`, must not be `None`") # noqa: E501 self._http_error_code = http_error_code diff --git a/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview.py b/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview.py index 32e358f1..cf33a8b7 100644 --- a/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview.py +++ b/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview.py @@ -118,8 +118,6 @@ class LinkPreview(Model): :param information: The information of this LinkPreview. :type information: object """ - if information is None: - raise ValueError("Invalid value for `information`, must not be `None`") # noqa: E501 self._information = information @@ -141,7 +139,5 @@ class LinkPreview(Model): :param http_error_code: The http_error_code of this LinkPreview. :type http_error_code: int """ - if http_error_code is None: - raise ValueError("Invalid value for `http_error_code`, must not be `None`") # noqa: E501 self._http_error_code = http_error_code diff --git a/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_base.py b/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_base.py index c587833c..f83edb7e 100644 --- a/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_base.py +++ b/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_base.py @@ -118,8 +118,6 @@ class LinkPreviewBase(Model): :param information: The information of this LinkPreviewBase. :type information: object """ - if information is None: - raise ValueError("Invalid value for `information`, must not be `None`") # noqa: E501 self._information = information @@ -141,7 +139,5 @@ class LinkPreviewBase(Model): :param http_error_code: The http_error_code of this LinkPreviewBase. :type http_error_code: int """ - if http_error_code is None: - raise ValueError("Invalid value for `http_error_code`, must not be `None`") # noqa: E501 self._http_error_code = http_error_code diff --git a/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_github_issue.py b/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_github_issue.py index a7dcde50..6cd025b3 100644 --- a/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_github_issue.py +++ b/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_github_issue.py @@ -120,8 +120,6 @@ class LinkPreviewGithubIssue(Model): :param information: The information of this LinkPreviewGithubIssue. :type information: LinkPreviewGithubIssueAllOfInformation """ - if information is None: - raise ValueError("Invalid value for `information`, must not be `None`") # noqa: E501 self._information = information @@ -143,7 +141,5 @@ class LinkPreviewGithubIssue(Model): :param http_error_code: The http_error_code of this LinkPreviewGithubIssue. :type http_error_code: int """ - if http_error_code is None: - raise ValueError("Invalid value for `http_error_code`, must not be `None`") # noqa: E501 self._http_error_code = http_error_code diff --git a/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_github_markdown.py b/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_github_markdown.py index 1bf0595a..51ffda0c 100644 --- a/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_github_markdown.py +++ b/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_github_markdown.py @@ -120,8 +120,6 @@ class LinkPreviewGithubMarkdown(Model): :param information: The information of this LinkPreviewGithubMarkdown. :type information: LinkPreviewGithubMarkdownAllOfInformation """ - if information is None: - raise ValueError("Invalid value for `information`, must not be `None`") # noqa: E501 self._information = information @@ -143,7 +141,5 @@ class LinkPreviewGithubMarkdown(Model): :param http_error_code: The http_error_code of this LinkPreviewGithubMarkdown. :type http_error_code: int """ - if http_error_code is None: - raise ValueError("Invalid value for `http_error_code`, must not be `None`") # noqa: E501 self._http_error_code = http_error_code diff --git a/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_github_pull_request.py b/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_github_pull_request.py index 343b6e5e..afbd59c9 100644 --- a/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_github_pull_request.py +++ b/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_github_pull_request.py @@ -120,8 +120,6 @@ class LinkPreviewGithubPullRequest(Model): :param information: The information of this LinkPreviewGithubPullRequest. :type information: LinkPreviewGithubIssueAllOfInformation """ - if information is None: - raise ValueError("Invalid value for `information`, must not be `None`") # noqa: E501 self._information = information @@ -143,7 +141,5 @@ class LinkPreviewGithubPullRequest(Model): :param http_error_code: The http_error_code of this LinkPreviewGithubPullRequest. :type http_error_code: int """ - if http_error_code is None: - raise ValueError("Invalid value for `http_error_code`, must not be `None`") # noqa: E501 self._http_error_code = http_error_code diff --git a/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_google_docs.py b/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_google_docs.py index c8ceb66d..14e104b8 100644 --- a/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_google_docs.py +++ b/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_google_docs.py @@ -120,8 +120,6 @@ class LinkPreviewGoogleDocs(Model): :param information: The information of this LinkPreviewGoogleDocs. :type information: LinkPreviewOpenGraphAllOfInformation """ - if information is None: - raise ValueError("Invalid value for `information`, must not be `None`") # noqa: E501 self._information = information @@ -143,7 +141,5 @@ class LinkPreviewGoogleDocs(Model): :param http_error_code: The http_error_code of this LinkPreviewGoogleDocs. :type http_error_code: int """ - if http_error_code is None: - raise ValueError("Invalid value for `http_error_code`, must not be `None`") # noqa: E501 self._http_error_code = http_error_code diff --git a/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_mdn_docs.py b/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_mdn_docs.py index 4f4a34c4..ed5b8399 100644 --- a/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_mdn_docs.py +++ b/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_mdn_docs.py @@ -120,8 +120,6 @@ class LinkPreviewMdnDocs(Model): :param information: The information of this LinkPreviewMdnDocs. :type information: LinkPreviewOpenGraphAllOfInformation """ - if information is None: - raise ValueError("Invalid value for `information`, must not be `None`") # noqa: E501 self._information = information @@ -143,7 +141,5 @@ class LinkPreviewMdnDocs(Model): :param http_error_code: The http_error_code of this LinkPreviewMdnDocs. :type http_error_code: int """ - if http_error_code is None: - raise ValueError("Invalid value for `http_error_code`, must not be `None`") # noqa: E501 self._http_error_code = http_error_code diff --git a/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_mozilla_bug.py b/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_mozilla_bug.py index 58d0e6ce..f61741ba 100644 --- a/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_mozilla_bug.py +++ b/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_mozilla_bug.py @@ -120,8 +120,6 @@ class LinkPreviewMozillaBug(Model): :param information: The information of this LinkPreviewMozillaBug. :type information: LinkPreviewOpenGraphAllOfInformation """ - if information is None: - raise ValueError("Invalid value for `information`, must not be `None`") # noqa: E501 self._information = information @@ -143,7 +141,5 @@ class LinkPreviewMozillaBug(Model): :param http_error_code: The http_error_code of this LinkPreviewMozillaBug. :type http_error_code: int """ - if http_error_code is None: - raise ValueError("Invalid value for `http_error_code`, must not be `None`") # noqa: E501 self._http_error_code = http_error_code diff --git a/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_open_graph.py b/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_open_graph.py index 61b8aa99..06455155 100644 --- a/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_open_graph.py +++ b/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_open_graph.py @@ -120,8 +120,6 @@ class LinkPreviewOpenGraph(Model): :param information: The information of this LinkPreviewOpenGraph. :type information: LinkPreviewOpenGraphAllOfInformation """ - if information is None: - raise ValueError("Invalid value for `information`, must not be `None`") # noqa: E501 self._information = information @@ -143,7 +141,5 @@ class LinkPreviewOpenGraph(Model): :param http_error_code: The http_error_code of this LinkPreviewOpenGraph. :type http_error_code: int """ - if http_error_code is None: - raise ValueError("Invalid value for `http_error_code`, must not be `None`") # noqa: E501 self._http_error_code = http_error_code diff --git a/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_specs.py b/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_specs.py index 7b6c5b0c..13d3172a 100644 --- a/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_specs.py +++ b/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_specs.py @@ -120,8 +120,6 @@ class LinkPreviewSpecs(Model): :param information: The information of this LinkPreviewSpecs. :type information: LinkPreviewOpenGraphAllOfInformation """ - if information is None: - raise ValueError("Invalid value for `information`, must not be `None`") # noqa: E501 self._information = information @@ -143,7 +141,5 @@ class LinkPreviewSpecs(Model): :param http_error_code: The http_error_code of this LinkPreviewSpecs. :type http_error_code: int """ - if http_error_code is None: - raise ValueError("Invalid value for `http_error_code`, must not be `None`") # noqa: E501 self._http_error_code = http_error_code diff --git a/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_webkit_bug.py b/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_webkit_bug.py index 82500613..d5233a03 100644 --- a/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_webkit_bug.py +++ b/gen/py/chromestatus_openapi/chromestatus_openapi/models/link_preview_webkit_bug.py @@ -120,8 +120,6 @@ class LinkPreviewWebkitBug(Model): :param information: The information of this LinkPreviewWebkitBug. :type information: LinkPreviewOpenGraphAllOfInformation """ - if information is None: - raise ValueError("Invalid value for `information`, must not be `None`") # noqa: E501 self._information = information @@ -143,7 +141,5 @@ class LinkPreviewWebkitBug(Model): :param http_error_code: The http_error_code of this LinkPreviewWebkitBug. :type http_error_code: int """ - if http_error_code is None: - raise ValueError("Invalid value for `http_error_code`, must not be `None`") # noqa: E501 self._http_error_code = http_error_code diff --git a/gen/py/chromestatus_openapi/chromestatus_openapi/openapi/openapi.yaml b/gen/py/chromestatus_openapi/chromestatus_openapi/openapi/openapi.yaml index dee8e98b..07802821 100644 --- a/gen/py/chromestatus_openapi/chromestatus_openapi/openapi/openapi.yaml +++ b/gen/py/chromestatus_openapi/chromestatus_openapi/openapi/openapi.yaml @@ -1960,11 +1960,6 @@ components: title: FeatureLink type: object LinkPreviewBase: - example: - information: "{}" - type: type - http_error_code: 0 - url: http://example.com/aeiou properties: url: format: url @@ -1974,14 +1969,14 @@ components: title: type type: string information: + nullable: true title: information type: object http_error_code: + nullable: true title: http_error_code type: integer required: - - http_error_code - - information - type - url title: LinkPreviewBase @@ -2012,8 +2007,6 @@ components: - properties: information: $ref: '#/components/schemas/LinkPreviewGithubIssue_allOf_information' - required: - - information type: object title: LinkPreviewGithubIssue LinkPreviewGithubPullRequest: @@ -2025,8 +2018,6 @@ components: - properties: information: $ref: '#/components/schemas/LinkPreviewGithubMarkdown_allOf_information' - required: - - information type: object LinkPreviewOpenGraph: allOf: @@ -2034,8 +2025,6 @@ components: - properties: information: $ref: '#/components/schemas/LinkPreviewOpenGraph_allOf_information' - required: - - information type: object title: LinkPreviewOpenGraph LinkPreviewMdnDocs: @@ -2058,17 +2047,17 @@ components: data: - information: "{}" type: type - http_error_code: 0 + http_error_code: 1 url: http://example.com/aeiou - information: "{}" type: type - http_error_code: 0 + http_error_code: 1 url: http://example.com/aeiou has_stale_links: true properties: data: items: - $ref: '#/components/schemas/LinkPreviewBase' + $ref: '#/components/schemas/LinkPreview' title: data type: array has_stale_links: diff --git a/openapi/api.yaml b/openapi/api.yaml index eba10bf2..5e1ca338 100644 --- a/openapi/api.yaml +++ b/openapi/api.yaml @@ -1237,8 +1237,6 @@ components: required: - url - type - - information - - http_error_code properties: url: type: string @@ -1247,8 +1245,10 @@ components: type: string information: type: object + nullable: true http_error_code: type: integer + nullable: true LinkPreview: allOf: - $ref: '#/components/schemas/LinkPreviewBase' @@ -1267,7 +1267,6 @@ components: allOf: - $ref: '#/components/schemas/LinkPreviewBase' - type: object - required: [information] properties: information: type: object @@ -1314,7 +1313,6 @@ components: allOf: - $ref: '#/components/schemas/LinkPreviewBase' - type: object - required: [information] properties: information: type: object @@ -1327,7 +1325,6 @@ components: allOf: - $ref: '#/components/schemas/LinkPreviewBase' - type: object - required: [information] properties: information: type: object @@ -1357,7 +1354,7 @@ components: data: type: array items: - $ref: '#/components/schemas/LinkPreviewBase' + $ref: '#/components/schemas/LinkPreview' has_stale_links: type: boolean FeatureLinksSummaryResponse: