Skip to content
This repository was archived by the owner on Dec 19, 2023. It is now read-only.

Commit 79b4f5d

Browse files
feat(#212): ensure correct spring configuration metadata is generated
1 parent a08544e commit 79b4f5d

File tree

5 files changed

+15
-31
lines changed

5 files changed

+15
-31
lines changed

playground-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/playground/boot/PlaygroundPropertiesConfiguration.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
import com.oembedler.moon.playground.boot.properties.PlaygroundProperties;
44
import lombok.Data;
55
import org.springframework.boot.context.properties.ConfigurationProperties;
6+
import org.springframework.boot.context.properties.NestedConfigurationProperty;
67
import org.springframework.validation.annotation.Validated;
78

89
@Data
910
@ConfigurationProperties(prefix = "graphql")
1011
@Validated
1112
public class PlaygroundPropertiesConfiguration {
1213

14+
@NestedConfigurationProperty
1315
private PlaygroundProperties playground = new PlaygroundProperties();
1416
}

playground-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/playground/boot/properties/PlaygroundProperties.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import com.fasterxml.jackson.annotation.JsonIgnore;
44
import com.fasterxml.jackson.annotation.JsonInclude;
55
import lombok.Data;
6+
import org.springframework.boot.context.properties.NestedConfigurationProperty;
67

78
import javax.validation.constraints.NotEmpty;
89
import java.util.Collections;
@@ -19,15 +20,18 @@ public class PlaygroundProperties {
1920
@NotEmpty
2021
private String subscriptionEndpoint = "/subscriptions";
2122

23+
@NestedConfigurationProperty
2224
@JsonIgnore
2325
private PlaygroundCdn cdn = new PlaygroundCdn();
2426

2527
@JsonIgnore
2628
private String pageTitle = "Playground";
2729

30+
@NestedConfigurationProperty
2831
private PlaygroundSettings settings;
2932

3033
private Map<String, String> headers = Collections.emptyMap();
3134

35+
@NestedConfigurationProperty
3236
private List<PlaygroundTab> tabs = Collections.emptyList();
3337
}

playground-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/playground/boot/properties/PlaygroundSettings.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,29 @@
88
import com.oembedler.moon.playground.boot.properties.settings.PlaygroundSchemaSettings;
99
import com.oembedler.moon.playground.boot.properties.settings.PlaygroundTracingSettings;
1010
import lombok.Data;
11+
import org.springframework.boot.context.properties.NestedConfigurationProperty;
1112

1213
@Data
1314
@JsonInclude(JsonInclude.Include.NON_NULL)
1415
public class PlaygroundSettings {
1516

17+
@NestedConfigurationProperty
1618
@JsonUnwrapped(prefix = "editor.")
1719
private PlaygroundEditorSettings editor;
1820

21+
@NestedConfigurationProperty
1922
@JsonUnwrapped(prefix = "prettier.")
2023
private PlaygroundPrettierSettings prettier;
2124

25+
@NestedConfigurationProperty
2226
@JsonUnwrapped(prefix = "request.")
2327
private PlaygroundRequestSettings request;
2428

29+
@NestedConfigurationProperty
2530
@JsonUnwrapped(prefix = "schema.")
2631
private PlaygroundSchemaSettings schema;
2732

33+
@NestedConfigurationProperty
2834
@JsonUnwrapped(prefix = "tracing.")
2935
private PlaygroundTracingSettings tracing;
3036
}

playground-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/playground/boot/properties/settings/PlaygroundSchemaSettings.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
import com.fasterxml.jackson.annotation.JsonInclude;
44
import com.fasterxml.jackson.annotation.JsonUnwrapped;
55
import lombok.Data;
6+
import org.springframework.boot.context.properties.NestedConfigurationProperty;
67

78
@Data
89
@JsonInclude(JsonInclude.Include.NON_NULL)
910
public class PlaygroundSchemaSettings {
1011

1112
private Boolean disableComments;
1213

14+
@NestedConfigurationProperty
1315
@JsonUnwrapped(prefix = "polling.")
1416
private PlaygroundSchemaPollingSettings polling;
1517
}
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,9 @@
11
{
2-
"groups": [
3-
{
4-
"name": "playground"
5-
}
6-
],
72
"properties": [
83
{
9-
"name": "playground.mapping",
4+
"name": "graphql.playground.mapping",
105
"defaultValue": "/playground",
116
"type": "java.lang.String"
12-
},
13-
{
14-
"name": "playground.endpoint.graphql",
15-
"defaultValue": "/graphql",
16-
"type": "java.lang.String"
17-
},
18-
{
19-
"name": "playground.endpoint.subscriptions",
20-
"defaultValue": "/subscriptions",
21-
"type": "java.lang.String"
22-
},
23-
{
24-
"name": "playground.cdn.enabled",
25-
"defaultValue": false,
26-
"type": "java.lang.Boolean"
27-
},
28-
{
29-
"name": "playground.cdn.version",
30-
"defaultValue": "latest",
31-
"type": "java.lang.String"
32-
},
33-
{
34-
"name": "playground.pageTitle",
35-
"defaultValue": "Playground",
36-
"type": "java.lang.String"
377
}
388
]
399
}

0 commit comments

Comments
 (0)