Skip to content

Commit 461621e

Browse files
authored
docs(appconfig): better docstring for app config content type (#35374)
### Issue # (if applicable) Closes #35093. ### Reason for this change Improve doc string to clarity what inputs are accepted for `contentType`. ### Description of changes Simple documentation additions. ### Describe any new or updated permissions being added None ### Description of how you validated changes None, only documentation changes. ### Checklist - [X] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 2ffc666 commit 461621e

File tree

1 file changed

+46
-6
lines changed

1 file changed

+46
-6
lines changed

packages/aws-cdk-lib/aws-appconfig/lib/configuration.ts

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,15 @@ export class HostedConfiguration extends ConfigurationBase {
416416
public readonly content: string;
417417

418418
/**
419-
* The content type of the hosted configuration.
419+
* The configuration content type, specified as a standard MIME type.
420+
* Supported examples include:
421+
* - `text/plain`
422+
* - `application/json`
423+
* - `application/octet-stream`
424+
* - `application/x-yaml`
425+
*
426+
* For an up-to-date list of valid MIME types, see:
427+
* https://www.iana.org/assignments/media-types/media-types.xhtml
420428
*/
421429
public readonly contentType?: string;
422430

@@ -591,7 +599,7 @@ export class SourcedConfiguration extends ConfigurationBase {
591599
private readonly locationUri: string;
592600
private readonly _cfnConfigurationProfile: CfnConfigurationProfile;
593601

594-
constructor (scope: Construct, id: string, props: SourcedConfigurationProps) {
602+
constructor(scope: Construct, id: string, props: SourcedConfigurationProps) {
595603
super(scope, id, props);
596604

597605
this.location = props.location;
@@ -839,7 +847,15 @@ export abstract class ConfigurationContent {
839847
* Defines the hosted configuration content from a file.
840848
*
841849
* @param inputPath The path to the file that defines configuration content
842-
* @param contentType The content type of the configuration
850+
* @param contentType The configuration content type, specified as a standard MIME type.
851+
* Supported examples include:
852+
* - `text/plain`
853+
* - `application/json`
854+
* - `application/octet-stream`
855+
* - `application/x-yaml`
856+
*
857+
* For an up-to-date list of valid MIME types, see:
858+
* https://www.iana.org/assignments/media-types/media-types.xhtml
843859
*/
844860
public static fromFile(inputPath: string, contentType?: string): ConfigurationContent {
845861
return {
@@ -852,7 +868,15 @@ export abstract class ConfigurationContent {
852868
* Defines the hosted configuration content from inline code.
853869
*
854870
* @param content The inline code that defines the configuration content
855-
* @param contentType The content type of the configuration
871+
* @param contentType The configuration content type, specified as a standard MIME type.
872+
* Supported examples include:
873+
* - `text/plain`
874+
* - `application/json`
875+
* - `application/octet-stream`
876+
* - `application/x-yaml`
877+
*
878+
* For an up-to-date list of valid MIME types, see:
879+
* https://www.iana.org/assignments/media-types/media-types.xhtml
856880
*/
857881
public static fromInline(content: string, contentType?: string): ConfigurationContent {
858882
return {
@@ -865,7 +889,15 @@ export abstract class ConfigurationContent {
865889
* Defines the hosted configuration content as JSON from inline code.
866890
*
867891
* @param content The inline code that defines the configuration content
868-
* @param contentType The content type of the configuration
892+
* @param contentType The configuration content type, specified as a standard MIME type.
893+
* Supported examples include:
894+
* - `text/plain`
895+
* - `application/json`
896+
* - `application/octet-stream`
897+
* - `application/x-yaml`
898+
*
899+
* For an up-to-date list of valid MIME types, see:
900+
* https://www.iana.org/assignments/media-types/media-types.xhtml
869901
*/
870902
public static fromInlineJson(content: string, contentType?: string): ConfigurationContent {
871903
return {
@@ -904,7 +936,15 @@ export abstract class ConfigurationContent {
904936
public abstract readonly content: string;
905937

906938
/**
907-
* The configuration content type.
939+
* The configuration content type, specified as a standard MIME type.
940+
* Supported examples include:
941+
* - `text/plain`
942+
* - `application/json`
943+
* - `application/octet-stream`
944+
* - `application/x-yaml`
945+
*
946+
* For an up-to-date list of valid MIME types, see:
947+
* https://www.iana.org/assignments/media-types/media-types.xhtml
908948
*/
909949
public abstract readonly contentType: string;
910950
}

0 commit comments

Comments
 (0)