Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Numbers cannot be used as identifiers for properties #452

Closed
jonaslagoni opened this issue Oct 11, 2021 · 2 comments
Closed

Numbers cannot be used as identifiers for properties #452

jonaslagoni opened this issue Oct 11, 2021 · 2 comments
Labels
bug Something isn't working stale
Milestone

Comments

@jonaslagoni
Copy link
Member

Describe the bug

Given a schema such as

{
    "type": "object",
    "description": "One or more icons that represent the extension, app, or theme. Recommended format: PNG; also BMP, GIF, ICO, JPEG.",
    "minProperties": 1,
    "properties": {
        "16": {
            "type": "string",
            "description": "Used as the favicon for an extension's pages and infobar."
        },
        "48": {
            "type": "string",
            "description": "Used on the extension management page (chrome://extensions)."
        },
        "128": {
            "type": "string",
            "description": "Used during installation and in the Chrome Web Store."
        },
        "256": {
            "type": "string",
            "description": "Used during installation and in the Chrome Web Store."
        }
    }
}

The following is generated:

export class Icons {
  private _16?: string;
  private _48?: string;
  private _128?: string;
  private _256?: string;
  private _additionalProperties?: Map<String, object | string | number | Array<unknown> | boolean | null>;

  constructor(input: {
    16?: string,
    48?: string,
    128?: string,
    256?: string,
  }) {
    this._16 = input.16;
    this._48 = input.48;
    this._128 = input.128;
    this._256 = input.256;
  }

  get 16(): string | undefined { return this._16; }
  set 16(16: string | undefined) { this._16 = 16; }

  get 48(): string | undefined { return this._48; }
  set 48(48: string | undefined) { this._48 = 48; }

  get 128(): string | undefined { return this._128; }
  set 128(128: string | undefined) { this._128 = 128; }

  get 256(): string | undefined { return this._256; }
  set 256(256: string | undefined) { this._256 = 256; }

  get additionalProperties(): Map<String, object | string | number | Array<unknown> | boolean | null> | undefined { return this._additionalProperties; }
  set additionalProperties(additionalProperties: Map<String, object | string | number | Array<unknown> | boolean | null> | undefined) { this._additionalProperties = additionalProperties; }
}

Related to #449

@jonaslagoni jonaslagoni added the bug Something isn't working label Oct 11, 2021
@jonaslagoni
Copy link
Member Author

Related BlackBox tests that currently is being blacklisted -

return file !== './docs/JsonSchemaDraft-4/chrome-manifest.json';

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity 😴

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant