Skip to content

Commit

Permalink
Merge pull request #106 from superfaceai/fix/enum_name_validation
Browse files Browse the repository at this point in the history
Add missing patter for enum name
  • Loading branch information
freaz committed Jul 18, 2023
2 parents c4df8eb + 7699253 commit 8b65ed1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Fixed
- Enum name validation using JSON Schema

### Fixed
- Fixed `UseCaseExampleNode` input to be only `ComlinkObjectLiteralNode`
Expand Down
1 change: 1 addition & 0 deletions src/interfaces/ast/profile-ast.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,7 @@
"type": "object"
},
"name": {
"pattern": "^[_a-zA-Z][_a-zA-Z0-9]*$",
"type": "string"
},
"value": {
Expand Down
3 changes: 3 additions & 0 deletions src/interfaces/ast/profile-ast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ export type Type = TypeName | TypeDefinition;
*/
export interface EnumValueNode extends ProfileASTNodeBase, DocumentedNode {
kind: 'EnumValue';
/**
* @pattern require('./utils').IDENTIFIER_RE_SOURCE
**/
name?: string;
value: string | number | boolean;
}
Expand Down

0 comments on commit 8b65ed1

Please sign in to comment.