Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

schema_checker에 코드쉐어 관련내용 추가 #313

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion coursegraph/schema_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def validate_string_or_sequence(value : str) -> str:
strictyaml.Optional("트랙"): EmptyList() | strictyaml.Seq(strictyaml.Str()),
strictyaml.Optional("마이크로디그리"): EmptyList() | strictyaml.Seq(strictyaml.Str()),
strictyaml.Optional("선수과목"): EmptyList() | strictyaml.Seq(strictyaml.Str()),
strictyaml.Optional("코드쉐어"): EmptyList() | strictyaml.Seq(strictyaml.Str()),
"실습여부": strictyaml.Str(),
"구분": strictyaml.Str()
}))
Expand All @@ -65,7 +66,7 @@ def validate_yaml(file_path : str):
try:
if subject["학년"] not in [1, 2, 3, 4, 5, 6]:
raise ValueError("학년은 1부터 6까지의 정수여야 합니다.")
for field_name in ["과목명", "트랙", "마이크로디그리", "선수과목"]:
for field_name in ["과목명", "트랙", "마이크로디그리", "선수과목","코드쉐어"]:
if field_name in subject:
validate_string_or_sequence(subject[field_name].data)
except ValueError as e:
Expand Down
4 changes: 4 additions & 0 deletions yamlSchema.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ coursegrap-py 프로젝트의 yaml 데이터 기본 스키마 (데이터 추가
- 학년:
- 학기:
- 과목명:
- 코드쉐어:
-
- 실습여부:
- 구분:
- 트랙:
Expand Down Expand Up @@ -53,6 +55,8 @@ Default key (필수로 지정되어져야하는 키) (value 입력 필수)
- 구분: (str) (한글, 영어 문자만 입력[특수문자 _ 와 . 사용 가능]) ex) 전선, 전기

option key (옵션으로 지정되는 키) (옵션으로 지정되어지는 key 의 경우 value를 공백으로 둘 수 있음 [공백으로 둘 경우 key:])
- 코드쉐어:
- (str) (한글, 영어 문자만 입력[특수문자 _ 와 . 사용 가능])
- 트랙:
- (str) (한글, 영어 문자만 입력[특수문자 _ 와 . 사용 가능])
- 마이크로디그리:
Expand Down