aws-cloudformation / aws-cloudformation/cloudformation-resource-schema

Validate examples of properties in schema according to schema

Open
#22 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Java
Stars
96
Forks
38
PR merge metrics
No merged PRs in 30d

Description

From https://github.com/aws-cloudformation/aws-cloudformation-rpdk/issues/68

At the moment, examples fields aren't validated. The result is invalid examples, e.g. this ARN (rouge dot at the end):

```
"Arn": {
"type": "string",
"pattern": "^arn:aws(-(cn|gov))?:[a-z-]+:(([a-z]+-)+[0-9])?:([0-9]{12})?:[^.]+$"
"examples": [
"arn:aws:sqs:us-east-2:123456789012:mystack-myqueue-15PG5C2FC1CW8."
]
},
```

It's a shame JSON schema doesn't do this, but we can add this.

Contributor guide

Open the contributing guide

Research direction

The issue names no source files or tests. Start by locating the schema-validation entry point, reproduce the invalid ARN example, and determine how property constraints are represented; done means examples are rejected when they fail the property's declared schema constraints.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, java
Domain
backend-api-design
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.