aws-cloudformation / cloudformation-resource-schema

The CloudFormation Resource Schema defines the shape and semantic for resources provisioned by CloudFormation. It is used by provider developers using the CloudFormation RPDK.
Apache License 2.0
93 stars 38 forks source link

Fix schema verification failure #26

Closed AugustXiaodm closed 5 years ago

AugustXiaodm commented 5 years ago

Issue #, if available: #25

Description of changes: Schema validation will validate user passed in resource schema against provider.definition.schema.v1.json. When loading "provider.definition.schema.v1.json", sometimes it throws "errorMessage":"A JSONObject text must begin with '{' at 0 [character 1 line 1]. Changed the way of loading the above json to definitionSchemaJsonObject = new JSONObject(new JSONTokener(this.getClass().getResourceAsStream(METASCHEMA_PATH))); inside the constructor to eliminate this failure.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

AidenAtSea commented 5 years ago

Interesting, looks like we just change the step orders of schema validation