با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
ویژگیهای type و format روی پارامترها و طرحوارهها میتواند برای تعیین نوع داده ویژگی استفاده شود. ویژگی type نشان دهنده نوع خاصیت زمانی است که در JSON درخواست و پاسخ می دهد (JSON از مجموعه کوچکی از انواع داده ها پشتیبانی می کند، برای جزئیات به json.org مراجعه کنید). ویژگی format اطلاعات بیشتری در مورد نوع اصلی ارائه می دهد. ویژگی ها همیشه دارای یک خاصیت type هستند، اما برخی ممکن است دارای ویژگی format نیز باشند.
به عنوان مثال، یک عدد صحیح 64 بیتی را نمی توان در JSON نشان داد (زیرا جاوا اسکریپت و JSON از اعداد صحیح تا 2^53 پشتیبانی می کنند). بنابراین، یک عدد صحیح 64 بیتی باید به عنوان یک رشته در درخواست ها/پاسخ های JSON نمایش داده شود. بنابراین ویژگی type روی "string" تنظیم می شود، اما ویژگی format روی "int64" تنظیم می شود تا نشان دهد که یک عدد صحیح 64 بیتی است.
مشخصات طرحواره JSON قبلاً مجموعه ای از مقادیر مشترک را برای ویژگی format تعریف می کند. Google APIs Discovery Service از برخی از این مقادیر پشتیبانی می کند و برخی دیگر را نیز تعریف می کند. لیست کامل مقادیر type و format پشتیبانی شده توسط Google APIs Discovery Service در زیر خلاصه شده است.
یک رشته دلخواه توسط مشخصات JSON Schema تعریف شده است.
string
byte
رشتهای از بایتهای محفظهشده و کدگذاریشده با base64، که با URL و نام فایل الفبای ایمن کدگذاری شده است (گاهی اوقات به عنوان "web-safe" یا "base64url" شناخته میشود). توسط RFC4648 تعریف شده است.
string
date
تاریخ RFC3339 در قالب YYYY-MM-DD. در مشخصات طرحواره JSON تعریف شده است.
string
date-time
یک مهر زمانی RFC3339 در زمان UTC. این در قالب yyyy-MM-ddTHH:mm:ss.SSSZ. بخش میلی ثانیه ای (."SSS") اختیاری است. در مشخصات طرحواره JSON تعریف شده است.
string
google-datetime
یک مهر زمانی RFC3339 در زمان UTC. این در قالب yyyy-MM-ddTHH:mm:ss.SSSZ. بخش میلی ثانیه ای (."SSS") اختیاری است.
string
google-duration
یک رشته به پسوند "s" ختم می شود (نشان دهنده ثانیه) و قبل از آن تعداد ثانیه، با نانوثانیه به صورت ثانیه کسری بیان می شود. نقطه همیشه به عنوان نقطه اعشار استفاده می شود، نه کاما.
string
google-fieldmask
رشته ای که نام فیلدها با کاما از هم جدا می شوند. نام میدان ها در قراردادهای نامگذاری شتر پایین نشان داده شده است.
string
int64
یک عدد صحیح امضا شده 64 بیتی. حداقل مقدار آن 9,223,372,036,854,775,808- و حداکثر مقدار 9,223,372,036,854,775,807 (شامل) است.
string
uint64
یک عدد صحیح بدون علامت 64 بیتی. دارای حداقل مقدار 0 و حداکثر مقدار (2^64)-1 (شامل).
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eThe \u003ccode\u003etype\u003c/code\u003e property defines the data type in JSON, while the \u003ccode\u003eformat\u003c/code\u003e property provides additional context about the underlying type.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003etype\u003c/code\u003e is always present, but \u003ccode\u003eformat\u003c/code\u003e is optional and offers further data type details.\u003c/p\u003e\n"],["\u003cp\u003eGoogle APIs Discovery Service supports standard JSON Schema formats and defines its own for specific Google data types.\u003c/p\u003e\n"],["\u003cp\u003eClient libraries may use language-specific types to represent these types and formats for better integration.\u003c/p\u003e\n"],["\u003cp\u003eThe table comprehensively lists all supported \u003ccode\u003etype\u003c/code\u003e and \u003ccode\u003eformat\u003c/code\u003e values used by the Google APIs Discovery Service.\u003c/p\u003e\n"]]],[],null,["# Type and format\n\nThe `type` and `format` properties on parameters and schemas can be used\nto determine the data type of the property. The `type` property indicates the type of\nthe property when its sent in JSON requests and responses (JSON supports a small set of data\ntypes, see [json.org](https://json.org) for details). The `format`\nproperty provides additional information about the underlying type. Properties will always have\na `type` property, but some may also have a `format` property.\n\n\nFor example, a 64-bit integer cannot be represented in JSON (since JavaScript and JSON support\nintegers up to 2\\^53). Therefore, a 64-bit integer must be represented as a string in JSON\nrequests/responses. So the `type` property will be set to \"string\", but the\n`format` property will be set to \"int64\" to indicate that it is a 64-bit integer.\n\n\nThe JSON Schema spec already [defines a set of common\nvalues](https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.23) for the `format` property. The Google APIs Discovery Service supports some\nof these values, and defines others as well. The full list of `type` and\n`format` values supported by Google APIs Discovery Service is summarized below.\n| **Note:** The [client libraries](https://developers.google.com/api-client-library/) that we automatically generate from an API's discovery document sometimes use language-idiomatic types for these types and formats. For example: A 64-bit integer is represented as type `string` in JSON requests and responses, but our generated Java client library uses the Java `long` type.\n\n| Type value | Format value | Meaning |\n| `any` | | The property may have any type. Defined by the [JSON Schema spec](https://tools.ietf.org/html/draft-zyp-json-schema-03). |\n| `any` | `google.protobuf.Value` | The property has the JSON representation of the type of [google.protobuf.Value](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/struct.proto). |\n| `array` | | A JavaScript array of values. The `items` property indicates the schema for the array values. Defined by the JSON Schema spec. |\n| `array` | `google.protobuf.ListValue` | The property has the JSON representation of the type of [google.protobuf.ListValue](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/struct.proto). |\n| `boolean` | | A boolean value, either \"true\" or \"false\". Defined by the JSON Schema spec. |\n| `integer` | `int32` | A 32-bit signed integer. It has a minimum value of -2,147,483,648 and a maximum value of 2,147,483,647 (inclusive). |\n| `integer` | `uint32` | A 32-bit unsigned integer. It has a minimum value of 0 and a maximum value of 4,294,967,295 (inclusive). |\n| `number` | `double` | A double-precision 64-bit IEEE 754 floating point. |\n| `number` | `float` | A single-precision 32-bit IEEE 754 floating point. |\n| `object` | | A JavaScript object. Defined by the JSON Schema spec. |\n| `object` | `google.protobuf.Struct` | The property has the JSON representation of the type of [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/struct.proto). |\n| `object` | `google.protobuf.Any` | The property has the JSON representation of the type of [google.protobuf.Any](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/any.proto). |\n| `string` | | An arbitrary string. Defined by the JSON Schema spec. |\n| `string` | `byte` | A padded, base64-encoded string of bytes, encoded with a URL and filename safe alphabet (sometimes referred to as \"web-safe\" or \"base64url\"). Defined by [RFC4648](https://tools.ietf.org/html/rfc4648). |\n| `string` | `date` | An RFC3339 date in the format YYYY-MM-DD. Defined in the JSON Schema spec. |\n| `string` | `date-time` | An RFC3339 timestamp in UTC time. This in the format of yyyy-MM-ddTHH:mm:ss.SSSZ. The milliseconds portion (\".SSS\") is optional. Defined in the JSON Schema spec. |\n| `string` | `google-datetime` | An RFC3339 timestamp in UTC time. This in the format of yyyy-MM-ddTHH:mm:ss.SSSZ. The milliseconds portion (\".SSS\") is optional. |\n| `string` | `google-duration` | A string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. The period is always used as the decimal point, not a comma. |\n| `string` | `google-fieldmask` | A string where field names are separated by a comma. Field names are represented in lower-camel naming conventions. |\n| `string` | `int64` | A 64-bit signed integer. It has a minimum value of -9,223,372,036,854,775,808 and a maximum value of 9,223,372,036,854,775,807 (inclusive). |\n| `string` | `uint64` | A 64-bit unsigned integer. It has a minimum value of 0 and a maximum value of (2\\^64)-1 (inclusive). |\n|------------|-----------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|"]]