@@ -228,122 +228,7 @@ definitions:
228228 properties :
229229 ' @type ' :
230230 type : string
231- description : |-
232- A URL/resource name that uniquely identifies the type of the serialized
233- protocol buffer message. This string must contain at least
234- one "/" character. The last segment of the URL's path must represent
235- the fully qualified name of the type (as in
236- `path/google.protobuf.Duration`). The name should be in a canonical form
237- (e.g., leading "." is not accepted).
238-
239- In practice, teams usually precompile into the binary all types that they
240- expect it to use in the context of Any. However, for URLs which use the
241- scheme `http`, `https`, or no scheme, one can optionally set up a type
242- server that maps type URLs to message definitions as follows:
243-
244- * If no scheme is provided, `https` is assumed.
245- * An HTTP GET on the URL must yield a [google.protobuf.Type][]
246- value in binary format, or produce an error.
247- * Applications are allowed to cache lookup results based on the
248- URL, or have them precompiled into a binary to avoid any
249- lookup. Therefore, binary compatibility needs to be preserved
250- on changes to types. (Use versioned type names to manage
251- breaking changes.)
252-
253- Note: this functionality is not currently available in the official
254- protobuf release, and it is not used for type URLs beginning with
255- type.googleapis.com. As of May 2023, there are no widely used type server
256- implementations and no plans to implement one.
257-
258- Schemes other than `http`, `https` (or the empty scheme) might be
259- used with implementation specific semantics.
260231 additionalProperties : {}
261- description : |-
262- `Any` contains an arbitrary serialized protocol buffer message along with a
263- URL that describes the type of the serialized message.
264-
265- Protobuf library provides support to pack/unpack Any values in the form
266- of utility functions or additional generated methods of the Any type.
267-
268- Example 1: Pack and unpack a message in C++.
269-
270- Foo foo = ...;
271- Any any;
272- any.PackFrom(foo);
273- ...
274- if (any.UnpackTo(&foo)) {
275- ...
276- }
277-
278- Example 2: Pack and unpack a message in Java.
279-
280- Foo foo = ...;
281- Any any = Any.pack(foo);
282- ...
283- if (any.is(Foo.class)) {
284- foo = any.unpack(Foo.class);
285- }
286- // or ...
287- if (any.isSameTypeAs(Foo.getDefaultInstance())) {
288- foo = any.unpack(Foo.getDefaultInstance());
289- }
290-
291- Example 3: Pack and unpack a message in Python.
292-
293- foo = Foo(...)
294- any = Any()
295- any.Pack(foo)
296- ...
297- if any.Is(Foo.DESCRIPTOR):
298- any.Unpack(foo)
299- ...
300-
301- Example 4: Pack and unpack a message in Go
302-
303- foo := &pb.Foo{...}
304- any, err := anypb.New(foo)
305- if err != nil {
306- ...
307- }
308- ...
309- foo := &pb.Foo{}
310- if err := any.UnmarshalTo(foo); err != nil {
311- ...
312- }
313-
314- The pack methods provided by protobuf library will by default use
315- 'type.googleapis.com/full.type.name' as the type URL and the unpack
316- methods only use the fully qualified type name after the last '/'
317- in the type URL, for example "foo.bar.com/x/y.z" will yield type
318- name "y.z".
319-
320- JSON
321- ====
322- The JSON representation of an `Any` value uses the regular
323- representation of the deserialized, embedded message, with an
324- additional field `@type` which contains the type URL. Example:
325-
326- package google.profile;
327- message Person {
328- string first_name = 1;
329- string last_name = 2;
330- }
331-
332- {
333- "@type": "type.googleapis.com/google.profile.Person",
334- "firstName": <string>,
335- "lastName": <string>
336- }
337-
338- If the embedded message type is well-known and has a custom JSON
339- representation, that representation will be embedded adding a field
340- `value` which holds the custom JSON in addition to the `@type`
341- field. Example (for message [google.protobuf.Duration][]):
342-
343- {
344- "@type": "type.googleapis.com/google.protobuf.Duration",
345- "value": "1.212s"
346- }
347232 restGet :
348233 type : object
349234 properties :
0 commit comments