From 79c1c69eb0bbdca0abb751690962d1eabd8bf91a Mon Sep 17 00:00:00 2001 From: jeqcho Date: Sun, 31 Aug 2025 14:34:35 -0400 Subject: [PATCH] docs(appconfig): better docstring for app config content type --- .../aws-appconfig/lib/configuration.ts | 52 ++++++++++++++++--- 1 file changed, 46 insertions(+), 6 deletions(-) diff --git a/packages/aws-cdk-lib/aws-appconfig/lib/configuration.ts b/packages/aws-cdk-lib/aws-appconfig/lib/configuration.ts index aad418863b13e..bd1bd9740f918 100644 --- a/packages/aws-cdk-lib/aws-appconfig/lib/configuration.ts +++ b/packages/aws-cdk-lib/aws-appconfig/lib/configuration.ts @@ -416,7 +416,15 @@ export class HostedConfiguration extends ConfigurationBase { public readonly content: string; /** - * The content type of the hosted configuration. + * The configuration content type, specified as a standard MIME type. + * Supported examples include: + * - `text/plain` + * - `application/json` + * - `application/octet-stream` + * - `application/x-yaml` + * + * For an up-to-date list of valid MIME types, see: + * https://www.iana.org/assignments/media-types/media-types.xhtml */ public readonly contentType?: string; @@ -591,7 +599,7 @@ export class SourcedConfiguration extends ConfigurationBase { private readonly locationUri: string; private readonly _cfnConfigurationProfile: CfnConfigurationProfile; - constructor (scope: Construct, id: string, props: SourcedConfigurationProps) { + constructor(scope: Construct, id: string, props: SourcedConfigurationProps) { super(scope, id, props); this.location = props.location; @@ -839,7 +847,15 @@ export abstract class ConfigurationContent { * Defines the hosted configuration content from a file. * * @param inputPath The path to the file that defines configuration content - * @param contentType The content type of the configuration + * @param contentType The configuration content type, specified as a standard MIME type. + * Supported examples include: + * - `text/plain` + * - `application/json` + * - `application/octet-stream` + * - `application/x-yaml` + * + * For an up-to-date list of valid MIME types, see: + * https://www.iana.org/assignments/media-types/media-types.xhtml */ public static fromFile(inputPath: string, contentType?: string): ConfigurationContent { return { @@ -852,7 +868,15 @@ export abstract class ConfigurationContent { * Defines the hosted configuration content from inline code. * * @param content The inline code that defines the configuration content - * @param contentType The content type of the configuration + * @param contentType The configuration content type, specified as a standard MIME type. + * Supported examples include: + * - `text/plain` + * - `application/json` + * - `application/octet-stream` + * - `application/x-yaml` + * + * For an up-to-date list of valid MIME types, see: + * https://www.iana.org/assignments/media-types/media-types.xhtml */ public static fromInline(content: string, contentType?: string): ConfigurationContent { return { @@ -865,7 +889,15 @@ export abstract class ConfigurationContent { * Defines the hosted configuration content as JSON from inline code. * * @param content The inline code that defines the configuration content - * @param contentType The content type of the configuration + * @param contentType The configuration content type, specified as a standard MIME type. + * Supported examples include: + * - `text/plain` + * - `application/json` + * - `application/octet-stream` + * - `application/x-yaml` + * + * For an up-to-date list of valid MIME types, see: + * https://www.iana.org/assignments/media-types/media-types.xhtml */ public static fromInlineJson(content: string, contentType?: string): ConfigurationContent { return { @@ -904,7 +936,15 @@ export abstract class ConfigurationContent { public abstract readonly content: string; /** - * The configuration content type. + * The configuration content type, specified as a standard MIME type. + * Supported examples include: + * - `text/plain` + * - `application/json` + * - `application/octet-stream` + * - `application/x-yaml` + * + * For an up-to-date list of valid MIME types, see: + * https://www.iana.org/assignments/media-types/media-types.xhtml */ public abstract readonly contentType: string; }