-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tools: Documented example schema for SOS guide (#5573)
* Documented example schema for SOS guide * Normalized validation regex * Streamline to_validate loop
- Loading branch information
1 parent
fb333c4
commit 1dfecb3
Showing
7 changed files
with
108 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
# Yamale Schema for curated sources metadata, which is the sources.yaml file in the metadata/curated folder. | ||
|
||
map(include('source'), key=regex('^[\da-z-]+$', name='source name')) | ||
map(include('source'), key=regex('^[-a-z0-9]+$', name='source name')) | ||
--- | ||
source: | ||
name: str(upper_start=True, no_end_punc=True) | ||
description: str(upper_start=True, end_punc=True) | ||
url: regex('^(http).+', name="URL") | ||
url: regex('^http', name="URL") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Yamale Schema for example metadata, which is all .yaml files in the metadata folder | ||
# with a _metadata.yaml suffix. | ||
|
||
map(include('example'), key=example_id()) | ||
--- | ||
example: | ||
title: str(upper_start=True, no_end_punc=True) | ||
title_abbrev: str(upper_start=True, no_end_punc=True) | ||
synopsis: str(required=False, lower_start=True, end_punc_or_semicolon=True) | ||
synopsis_list: list(str(upper_start=True, end_punc=True), required=False) | ||
category: str(required=False, upper_start=True, no_end_punc=True) | ||
guide_topic: include('guide_topic', required=False) | ||
languages: map(include('language'), key=enum('Bash', 'C++', 'CLI', 'Go', 'Java', 'JavaScript', 'Kotlin', '.NET', 'PHP', 'Python', 'Ruby', 'Rust', 'SAP ABAP', 'Swift')) | ||
service_main: service_name(required=False) | ||
services: map(map(key=str(), required=False), key=service_name()) | ||
|
||
guide_topic: | ||
title: str(upper_start=True, no_end_punc=True) | ||
url: include('doc_url', required=False) | ||
|
||
language: | ||
versions: list(include('version')) | ||
|
||
# Per-language excerpts for the example. Languages and SDK versions are defined in .doc_gen/metadata/sdk_metadata.yaml | ||
version: | ||
sdk_version: int(min=1) | ||
github: regex('^(?!http).+', name="relative URL", required=False) | ||
sdkguide: include('doc_url', required=False) | ||
excerpts: list(include('excerpt'), required=False) | ||
block_content: block_content(required=False) | ||
add_services: map(key=service_name(), required=False) | ||
|
||
# The references to code content that will be included in the example's content. | ||
excerpt: | ||
description: str(required=False, upper_start=True, end_punc=True) | ||
snippet_tags: list(str(), required=False) | ||
snippet_files: list(str(), required=False) | ||
|
||
service_slug_regex: regex('^[-a-z0-9]+$', name='service slug') | ||
doc_url: regex('^(?!https://docs.aws.amazon.com/).+', name="relative documentation URL") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters