Skip to content

Commit 3bc73bd

Browse files
authored
fix: various small fixes (#3)
* fix: omit space_id from provider definition * fix: set provider version to 0.5.4 * fix: change SpaceID to int * fix: update site-config schema
1 parent c405c28 commit 3bc73bd

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

internal/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ package internal
33
type StoryblokConfig struct {
44
URL string `mapstructure:"url"`
55
Token string `mapstructure:"token"`
6-
SpaceID string `mapstructure:"space_id"`
6+
SpaceID int `mapstructure:"space_id"`
77
}

internal/plugin.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111

1212
func NewStoryblokPlugin() schema.MachComposerPlugin {
1313
state := &Plugin{
14-
provider: "0.3.7",
14+
provider: "0.5.4",
1515
siteConfigs: map[string]*StoryblokConfig{},
1616
}
1717

@@ -91,7 +91,7 @@ func (p *Plugin) getSiteConfig(site string) *StoryblokConfig {
9191
if cfg.Token != "" {
9292
result.Token = cfg.Token
9393
}
94-
if cfg.SpaceID != "" {
94+
if cfg.SpaceID != 0 {
9595
result.SpaceID = cfg.SpaceID
9696
}
9797
}
@@ -126,7 +126,6 @@ func (p *Plugin) TerraformRenderResources(site string) (string, error) {
126126
provider "storyblok" {
127127
{{ renderProperty "url" .URL }}
128128
{{ renderProperty "token" .Token }}
129-
{{ renderProperty "space_id" .SpaceID }}
130129
}
131130
`
132131
return helpers.RenderGoTemplate(template, cfg)

internal/schemas/site-config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
],
88
"properties": {
99
"space_id": {
10-
"type": "string"
10+
"type": "integer"
1111
},
1212
"url": {
1313
"type": "string"

0 commit comments

Comments
 (0)