Skip to content

Commit

Permalink
fix(app-builder-lib): Overriding OutgoingHttpHeaders schema props (el…
Browse files Browse the repository at this point in the history
…ectron-userland#6775)

* fix: Overriding additionalProperties to allow electron-builder's schema validator to read requestHeaders. Fixes: electron-userland#6635
  • Loading branch information
mmaietta authored Apr 11, 2022
1 parent 5a0bab1 commit e9a87a7
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/polite-bugs-sparkle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"app-builder-lib": patch
---

fix(app-builder-lib): Overriding `additionalProperties` to allow electron-builder's schema validator to read `publish.requestHeaders`
2 changes: 2 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Test

on:
push:
branches:
master
pull_request:

# Allows you to run this workflow manually from the Actions tab
Expand Down
19 changes: 17 additions & 2 deletions packages/app-builder-lib/scheme.json
Original file line number Diff line number Diff line change
Expand Up @@ -4240,7 +4240,22 @@
"type": "object"
},
"OutgoingHttpHeaders": {
"additionalProperties": false,
"additionalProperties": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": [
"string",
"number"
]
}
]
},
"type": "object"
},
"PkgBackgroundOptions": {
Expand Down Expand Up @@ -4405,7 +4420,7 @@
"type": "null"
}
],
"description": "Identifies applications that must be closed before the package is installed.\\n\\nCorresponds to [must-close](https://developer.apple.com/library/archive/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html#//apple_ref/doc/uid/TP40005370-CH100-SW77)"
"description": "Identifies applications that must be closed before the package is installed.\n\nCorresponds to [must-close](https://developer.apple.com/library/archive/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html#//apple_ref/doc/uid/TP40005370-CH100-SW77)."
},
"overwriteAction": {
"anyOf": [
Expand Down
19 changes: 18 additions & 1 deletion scripts/fix-schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,25 @@ let o = schema.definitions.PlugDescriptor.additionalProperties.anyOf[0]
delete o.typeof
o.type = "object"

schema.definitions.OutgoingHttpHeaders.additionalProperties = {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": [
"string",
"number"
]
}
]
}

o = schema.definitions.SnapOptions.properties.environment.anyOf[0] = {
additionalProperties: {type: "string"},
additionalProperties: { type: "string" },
type: "object",
}

Expand Down

0 comments on commit e9a87a7

Please sign in to comment.