Skip to content

Commit 9169893

Browse files
author
Josh
authored
Update README.md (#2)
1 parent c4fd938 commit 9169893

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

README.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ import "oapi/v1/method.proto";
9696
import "oapi/v1/service.proto";
9797

9898
option (oapi.v1.file) = {
99-
host: "myawesomeapi.com"
99+
servers: {
100+
url: "myawesomeapi.com"
101+
}
100102

101103
security_schemes: {
102104
name: "bearer_auth"
@@ -150,9 +152,9 @@ message CreateSomethingResponse {
150152
> the best I can.
151153
152154
<details>
153-
<summary><h3>Host definitions</h3></summary>
155+
<summary><h3>Server definitions</h3></summary>
154156

155-
You can define hosts at the file, service, or method level. Each one overrides
157+
You can define servers at the file, service, or method level. Each one overrides
156158
the previous. This allows for more advanced composition.
157159

158160
**Example:**
@@ -167,17 +169,23 @@ import "oapi/v1/service.proto";
167169
168170
169171
option (oapi.v1.file) = {
170-
host: "myawesomeapi.com" // file-defined for all services and methods
172+
servers {
173+
url: "myawesomeapi.com" // file-defined for all services and methods
174+
}
171175
};
172176
173177
service MyService {
174178
option (oapi.v1.service) = {
175-
host: "myawesomeapi2.com" // overrides file-defined
179+
servers {
180+
url: "myawesomeapi2.com" // overrides file-defined
181+
}
176182
};
177183
178184
rpc CreateSomething (google.protobuf.Empty) returns (google.protobuf.Empty) {
179185
option (oapi.v1.method) = {
180-
host: "myaweseomeapi3.com" // overrides service-defined
186+
servers {
187+
url: "myaweseomeapi3.com" // overrides service-defined
188+
}
181189
};
182190
}
183191
}
@@ -206,7 +214,9 @@ import "oapi/v1/method.proto";
206214
import "oapi/v1/service.proto";
207215
208216
option (oapi.v1.file) = {
209-
host: "myawesomeapi.com"
217+
servers {
218+
url: "myawesomeapi.com"
219+
}
210220
};
211221
212222
service MyService {

0 commit comments

Comments
 (0)