Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Singleton as a List of NestedTypes? #448

Unanswered
indeox asked this question in Q&A
Discussion options

Is there a way to define a singleton as a list of nested types?

For example, say you have a YML which only has a list of objects at the root level (no keys, just items):

# categories.yml
- id: categoryA
 name: Category A
- id: categoryB
 name: CategoryB
- id: categoryC
 name: Category C

Doesn't look like there's a way to define that document as-is.

It's not really a big deal though, as the YML could be modified to put the list inside a named key as a workaround.

# categories.yml
categories:
 - id: categoryA
 name: Category A
 
 - id: categoryB
 name: CategoryB
 
 - id: categoryC
 name: Category C

It's possibly not be a very common use-case though.

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant
Converted from issue

This discussion was converted from issue #446 on May 03, 2023 19:49.

AltStyle によって変換されたページ (->オリジナル) /