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

Doesn't allow empty action-types.yml if action has no inputs and outputs #22

Closed
krzema12 opened this issue Jul 18, 2022 · 1 comment
Closed
Assignees
Labels
bug Something isn't working

Comments

@krzema12
Copy link
Member

krzema12 commented Jul 18, 2022

Exception in thread "main" com.charleskorn.kaml.EmptyYamlDocumentException at <root> on line 1, column 1: The YAML document is empty.
	at com.charleskorn.kaml.YamlParser.<init>(YamlParser.kt:41)
	at com.charleskorn.kaml.Yaml.parseToYamlNodeFromReader(Yaml.kt:63)
	at com.charleskorn.kaml.Yaml.decodeFromReader(Yaml.kt:52)
	at com.charleskorn.kaml.Yaml.decodeFromString(Yaml.kt:44)
	at it.krzeminski.githubactionstyping.parsing.TypesManifestParsingKt.parseTypesManifest(TypesManifestParsing.kt:35)
	at it.krzeminski.githubactionstyping.ManifestsToReportKt.manifestsToReport(ManifestsToReport.kt:11)
	at it.krzeminski.githubactionstyping.MainKt.main(Main.kt:19)
	at it.krzeminski.githubactionstyping.MainKt.main(Main.kt)

When writing

inputs:

this is returned:

Exception in thread "main" com.charleskorn.kaml.InvalidPropertyValueException at inputs on line 1, column 8: Value for 'inputs' is invalid: Unexpected null or empty value for non-null field.
	at com.charleskorn.kaml.YamlMapLikeInputBase.fromCurrentValue(YamlMapLikeInputBase.kt:55)
	at com.charleskorn.kaml.YamlObjectInput.beginStructure(YamlObjectInput.kt:78)
	at kotlinx.serialization.internal.AbstractCollectionSerializer.merge(CollectionSerializers.kt:29)
	at kotlinx.serialization.internal.AbstractCollectionSerializer.deserialize(CollectionSerializers.kt:43)
	at kotlinx.serialization.encoding.Decoder$DefaultImpls.decodeSerializableValue(Decoding.kt:260)
	at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:16)
	at com.charleskorn.kaml.YamlInput.decodeSerializableValue(YamlInput.kt:103)
	at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:43)
	at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableElement(AbstractDecoder.kt:70)
	at it.krzeminski.githubactionstyping.parsing.TypesManifest$$serializer.deserialize(TypesManifestParsing.kt:8)
	at it.krzeminski.githubactionstyping.parsing.TypesManifest$$serializer.deserialize(TypesManifestParsing.kt:8)
	at kotlinx.serialization.encoding.Decoder$DefaultImpls.decodeSerializableValue(Decoding.kt:260)
	at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:16)
	at com.charleskorn.kaml.YamlInput.decodeSerializableValue(YamlInput.kt:103)
	at com.charleskorn.kaml.Yaml.decodeFromReader(Yaml.kt:55)
	at com.charleskorn.kaml.Yaml.decodeFromString(Yaml.kt:44)
	at it.krzeminski.githubactionstyping.parsing.TypesManifestParsingKt.parseTypesManifest(TypesManifestParsing.kt:35)
	at it.krzeminski.githubactionstyping.ManifestsToReportKt.manifestsToReport(ManifestsToReport.kt:11)
	at it.krzeminski.githubactionstyping.MainKt.main(Main.kt:19)
	at it.krzeminski.githubactionstyping.MainKt.main(Main.kt)
Caused by: com.charleskorn.kaml.UnexpectedNullValueException at inputs on line 1, column 8: Unexpected null or empty value for non-null field.
	at com.charleskorn.kaml.YamlNullInput.beginStructure(YamlNullInput.kt:32)
	at com.charleskorn.kaml.YamlObjectInput$beginStructure$1.invoke(YamlObjectInput.kt:78)
	at com.charleskorn.kaml.YamlObjectInput$beginStructure$1.invoke(YamlObjectInput.kt:78)
	at com.charleskorn.kaml.YamlMapLikeInputBase.fromCurrentValue(YamlMapLikeInputBase.kt:52)
	... 19 more
@krzema12 krzema12 added the bug Something isn't working label Jul 18, 2022
@krzema12 krzema12 self-assigned this Jul 22, 2022
krzema12 added a commit that referenced this issue Jul 22, 2022
Ideally we'd like to support also something like:

```yaml
types:
```

but there's a problem with the YAML parser that I'm going to clarify as
a follow-up.
@krzema12
Copy link
Member Author

See https://yaml.org/spec/1.2-old/spec.html#id2805071 - such YAML:

inputs:

is equivalent to

inputs: null

Let's try not supporting empty inputs:.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant