|
2 | 2 | # SPDX-License-Identifier: Apache-2.0 |
3 | 3 |
|
4 | 4 | from typing import Dict, Set, Tuple, Any, List, Optional, Union |
5 | | -from pathlib import Path |
6 | 5 | from .metadata import ( |
7 | 6 | Example, |
8 | 7 | Language, |
9 | 8 | Url, |
10 | 9 | Version, |
11 | 10 | Excerpt, |
12 | 11 | Person, |
13 | | - FeedbackCti, |
14 | 12 | ) |
15 | 13 | from .sdks import Sdk |
16 | 14 | from .services import Service |
@@ -220,23 +218,6 @@ def person_from_yaml( |
220 | 218 | return Person(name, alias) |
221 | 219 |
|
222 | 220 |
|
223 | | -def feedback_cti_from_yaml( |
224 | | - yaml: Union[None, Dict[str, Optional[str]]] |
225 | | -) -> Optional[Union[FeedbackCti, MetadataParseError]]: |
226 | | - if yaml is None: |
227 | | - return None |
228 | | - category = yaml.get("category") |
229 | | - type = yaml.get("type") |
230 | | - item = yaml.get("item") |
231 | | - |
232 | | - if category is None or type is None or item is None: |
233 | | - return metadata_errors.InvalidFeedbackCti( |
234 | | - feedback_cti="|".join([str(category), str(type), str(item)]) |
235 | | - ) |
236 | | - |
237 | | - return FeedbackCti(category, type, item) |
238 | | - |
239 | | - |
240 | 221 | def version_from_yaml( |
241 | 222 | yaml: Dict[str, Any], |
242 | 223 | cross_content_blocks: Set[str], |
@@ -284,9 +265,9 @@ def version_from_yaml( |
284 | 265 | elif author is not None: |
285 | 266 | errors.append(author) |
286 | 267 |
|
287 | | - owner = feedback_cti_from_yaml(yaml.get("owner")) |
288 | | - if owner is not None and not isinstance(owner, FeedbackCti): |
289 | | - errors.append(owner) |
| 268 | + owner = yaml.get("owner") |
| 269 | + if owner and not isinstance(owner, str): |
| 270 | + errors.append(metadata_errors.InvalidFieldType(reason="must be string")) |
290 | 271 | owner = None |
291 | 272 |
|
292 | 273 | add_services = parse_services(yaml.get("add_services", {}), errors) |
|
0 commit comments