Skip to content

Commit c47b7a1

Browse files
committed
docs(gdscript): review the template files
1 parent 28efebd commit c47b7a1

File tree

5 files changed

+33
-34
lines changed

5 files changed

+33
-34
lines changed

modules/openapi-generator/src/main/resources/gdscript/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ Godot does not have an `Exception` (`try / catch`) mechanism, by design.
2929
Therefore, whenever there's trouble in paradise, we pass around an `ApiError` object. (a `RefCounted`, don't worry about garbage collection)
3030

3131

32-
### AoiResponse
32+
### ApiResponse
3333

34-
A wrapper for an Api Response, used in callbacks.
34+
A wrapper for an API Response, used in callbacks.
3535
Holds the HTTP components of the Response, as well as the deserialized `data` (if any).
3636

3737

modules/openapi-generator/src/main/resources/gdscript/core/ApiConfig.handlebars

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ enum LogLevel {
3838
}
3939

4040

41-
# Log level to configure verbosity.
42-
# @export_enum ain't working for ints yet (2023-03)
41+
## Log level to configure verbosity.
4342
@export var log_level := LogLevel.WARNING
4443

4544
{{!--
@@ -57,9 +56,9 @@ var bee_client: HTTPClient:
5756
return bee_client
5857
--}}
5958

60-
# The host to connect to, with or without the protocol scheme.
61-
# Eg: "gitea.com", "https://gitea.com"
62-
# We toggle TLS accordingly to the provided scheme, if any.
59+
## The host to connect to, with or without the protocol scheme.
60+
## Eg: "gitea.com", "https://gitea.com"
61+
## We toggle TLS accordingly to the provided scheme, if any.
6362
@export var host := BEE_DEFAULT_HOST:
6463
set(value):
6564
if value.begins_with("https://"):
@@ -71,14 +70,14 @@ var bee_client: HTTPClient:
7170
host = value
7271

7372

74-
# Port through which the connection will be established.
75-
# Note: changing the host may change the port as well if the scheme was provided, see above.
73+
## Port through which the connection will be established.
74+
## NOTE: changing the host may change the port as well if the scheme was provided, see above.
7675
@export var port := BEE_DEFAULT_PORT_HTTP
7776

7877

79-
# Headers used as base for all requests made by Api instances using this config.
80-
# Those are the lowest priority headers, and are merged with custom headers provided in the bee_request() method call
81-
# as well as the headers override below, to compute the final, actually sent headers.
78+
## Headers used as base for all requests made by Api instances using this config.
79+
## Those are the lowest priority headers, and are merged with custom headers provided in the bee_request() method call
80+
## as well as the headers override below, to compute the final, actually sent headers.
8281
@export var headers_base := {
8382
# Stigmergy: everyone does what is left to do (like ants do)
8483
"User-Agent": "Stigmergiac/1.0 (Godot)",
@@ -88,30 +87,30 @@ var bee_client: HTTPClient:
8887
}
8988

9089

91-
# High-priority headers, they will always override other headers coming from the base above or the method call.
90+
## High-priority headers, they will always override other headers coming from the base above or the method call.
9291
@export var headers_override := {}
9392

9493

95-
# Duration of sleep between poll() calls.
94+
## Duration of sleep between poll() calls.
9695
@export var polling_interval_ms := BEE_DEFAULT_POLLING_INTERVAL_MS # milliseconds
9796

9897

99-
# Enable the Transport Security Layer (packet encryption, HTTPS)
98+
## Enable the Transport Security Layer (packet encryption, HTTPS)
10099
@export var tls_enabled := false:
101100
set(value):
102101
tls_enabled = value
103102
port = BEE_DEFAULT_PORT_HTTPS if tls_enabled else BEE_DEFAULT_PORT_HTTP
104103

105104

106-
# You should preload your *.crt file (the whole chain) in here if you want TLS.
107-
# I usually concatenate my /etc/ssl/certs/ca-certificates.crt and webserver certs here.
108-
# Remember to add the *.crt file to the exports, if necessary.
105+
## You should preload your *.crt file (the whole chain) in here if you want TLS.
106+
## I usually concatenate my /etc/ssl/certs/ca-certificates.crt and webserver certs here.
107+
## Remember to add the *.crt file to the exports, if necessary.
109108
@export var trusted_chain: X509Certificate # only used if tls is enabled
110109
@export var common_name_override := "" # for TLSOptions
111110

112111

113-
# Dynamic accessor using the TLS properties above, but you may inject your own
114-
# for example if you need to use TLSOptions.client_unsafe. Best not @export this.
112+
## Dynamic accessor using the TLS properties above, but you may inject your own
113+
## for example if you need to use TLSOptions.client_unsafe. Best not @export this.
115114
var tls_options: TLSOptions:
116115
set(value):
117116
tls_options = value
@@ -164,7 +163,7 @@ func set_security_{{name}}(value: String):
164163

165164

166165
{{else}}
167-
# → Skipped: not implemented in the gdscript templates. (contribs welcome)
166+
# → Skipped: not implemented in the gdscript templates. (contribs are welcome)
168167

169168

170169
{{/if}}

modules/openapi-generator/src/main/resources/gdscript/core/ApiError.handlebars

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,22 @@ class_name {{>partials/api_error_class_name}}
1010
# it will trigger the error callback, with an instance of this as parameter.
1111
#
1212

13-
# Helps finding the error in the code, among other things.
14-
# Could be a UUID, or even a translation key, so long as it's unique.
15-
# Right now we're mostly using a lowercase ~namespace joined by dots. (.)
13+
## Helps finding the error in the code, among other things.
14+
## Could be a UUID, or even a translation key, so long as it's unique.
15+
## Right now we're mostly using a lowercase ~namespace joined by dots. (.)
1616
@export var identifier := ""
1717

18-
# A message for humans. May be multiline.
18+
## A message for humans. May be multiline.
1919
@export var message := ""
2020

21-
# One of Godot's ERR_XXXX, when relevant.
21+
## One of Godot's ERR_XXXX, when relevant.
2222
@export var internal_code := OK
2323

24-
# The HTTP response code, if any. (usually >= 400)
25-
# DEPRECATED: prefer reading from response object below
24+
## The HTTP response code, if any. (usually >= 400)
25+
## DEPRECATED: prefer reading from response object below
2626
@export var response_code := HTTPClient.RESPONSE_OK
2727

28-
# The HTTP response, if any.
28+
## The HTTP response, if any.
2929
@export var response: {{>partials/api_response_class_name}}
3030

3131

modules/openapi-generator/src/main/resources/gdscript/core/ApiResponse.handlebars

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ class_name {{>partials/api_response_class_name}}
1111
# is injected in the error object.
1212
#
1313

14-
# Headers sent back by the server
14+
## Headers sent back by the server
1515
@export var headers := Dictionary()
1616

17-
# The HTTP response code, if any. A constant like HTTPClient.RESPONSE_XXXX
17+
## The HTTP response code, if any. A constant like HTTPClient.RESPONSE_XXXX
1818
@export var code := 0
1919

20-
# Raw body of this response, in String form (before deserialization)
20+
## Raw body of this response, in String form (before deserialization)
2121
@export var body := ""
2222

23-
# Deserialized body (may be pretty much any type)
23+
## Deserialized body (may be pretty much any type)
2424
var data
2525

2626

modules/openapi-generator/src/main/resources/gdscript/utils/extract_reserved_words.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@ def add_word(word):
5959

6060
write_line()
6161

62-
print(words_code)
62+
print(words_code)

0 commit comments

Comments
 (0)