Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 293 for json (0.14 sec)

  1. docs/pt/docs/tutorial/schema-extra-example.md

    O **JSON Schema** na verdade não tem um campo `example` nos padrões. Versões recentes do JSON Schema definem um campo <a href="https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.9.5" class="external-link" target="_blank">`examples`</a>, mas o OpenAPI 3.0.3 é baseado numa versão mais antiga do JSON Schema que não tinha `examples`.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 6.1K bytes
    - Viewed (0)
  2. common-protos/k8s.io/apimachinery/pkg/runtime/generated.proto

    //
    // 	type MyAPIObject struct {
    // 		runtime.TypeMeta `json:",inline"`
    // 		MyPlugin runtime.Object `json:"myPlugin"`
    // 	}
    //
    // 	type PluginA struct {
    // 		AOption string `json:"aOption"`
    // 	}
    //
    // // External package:
    //
    // 	type MyAPIObject struct {
    // 		runtime.TypeMeta `json:",inline"`
    // 		MyPlugin runtime.RawExtension `json:"myPlugin"`
    // 	}
    //
    // 	type PluginA struct {
    Plain Text
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Mon Mar 11 18:43:24 GMT 2024
    - 4.2K bytes
    - Viewed (0)
  3. docs/en/docs/tutorial/encoder.md

    It doesn't return a large `str` containing the data in JSON format (as a string). It returns a Python standard data structure (e.g. a `dict`) with values and sub-values that are all compatible with JSON.
    
    !!! note
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 1.8K bytes
    - Viewed (0)
  4. docs/zh/docs/tutorial/encoder.md

    # JSON 兼容编码器
    
    在某些情况下,您可能需要将数据类型(如Pydantic模型)转换为与JSON兼容的数据类型(如`dict`、`list`等)。
    
    比如,如果您需要将其存储在数据库中。
    
    对于这种要求, **FastAPI**提供了`jsonable_encoder()`函数。
    
    ## 使用`jsonable_encoder`
    
    让我们假设你有一个数据库名为`fake_db`,它只能接收与JSON兼容的数据。
    
    例如,它不接收`datetime`这类的对象,因为这些对象与JSON不兼容。
    
    因此,`datetime`对象必须将转换为包含<a href="https://en.wikipedia.org/wiki/ISO_8601" class="external-link" target="_blank">ISO格式化</a>的`str`类型对象。
    
    同样,这个数据库也不会接收Pydantic模型(带有属性的对象),而只接收`dict`。
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 1.7K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/WebPlatformToAsciiData.kt

    package okhttp3
    
    import kotlinx.serialization.Serializable
    import kotlinx.serialization.decodeFromString
    import kotlinx.serialization.json.Json
    
    /**
     * A test from the [Web Platform To ASCII](https://github.com/web-platform-tests/wpt/blob/master/url/resources/toascii.json).
     *
     * Each test is a line of the file `toascii.json`.
     */
    @Serializable
    class WebPlatformToAsciiData {
      var input: String? = null
      var output: String? = null
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Dec 20 23:27:07 GMT 2023
    - 1.4K bytes
    - Viewed (0)
  6. build-logic/binary-compatibility/src/main/kotlin/gradlebuild/binarycompatibility/SortAcceptedApiChangesTask.kt

            val json = formatChanges(sortedChanges)
            apiChangesFile.asFile.get().bufferedWriter().use { out -> out.write(json) }
        }
    
        private
        fun formatChanges(changes: List<AbstractAcceptedApiChangesMaintenanceTask.AcceptedApiChange>): String {
            val gson: Gson = GsonBuilder().setPrettyPrinting().create()
            val initialString = gson.toJson(AcceptedApiChanges(changes))
    Plain Text
    - Registered: Wed May 01 11:36:15 GMT 2024
    - Last Modified: Fri Sep 30 18:18:04 GMT 2022
    - 2.1K bytes
    - Viewed (0)
  7. docs/ja/docs/tutorial/encoder.md

    そのために`jsonable_encoder`を使用することができます。
    
    Pydanticモデルのようなオブジェクトを受け取り、JSON互換版を返します:
    
    ```Python hl_lines="5 22"
    {!../../../docs_src/encoder/tutorial001.py!}
    ```
    
    この例では、Pydanticモデルを`dict`に、`datetime`を`str`に変換します。
    
    呼び出した結果は、Pythonの標準の<a href="https://docs.python.org/3/library/json.html#json.dumps" class="external-link" target="_blank">`json.dumps()`</a>でエンコードできるものです。
    
    これはJSON形式のデータを含む大きな`str`を(文字列として)返しません。JSONと互換性のある値とサブの値を持つPython標準のデータ構造(例:`dict`)を返します。
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Jan 22 20:09:02 GMT 2024
    - 1.9K bytes
    - Viewed (0)
  8. okhttp-hpacktests/src/test/java/okhttp3/internal/http2/hpackjson/HpackJsonUtil.kt

              @FromJson fun byteStringFromJson(json: String) = json.decodeHex()
            },
          )
          .add(KotlinJsonAdapterFactory())
          .build()
      private val STORY_JSON_ADAPTER = MOSHI.adapter(Story::class.java)
    
      private val fileSystem = FileSystem.SYSTEM
    
      private fun readStory(source: BufferedSource): Story {
        return STORY_JSON_ADAPTER.fromJson(source)!!
      }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.3K bytes
    - Viewed (0)
  9. docs/fr/docs/advanced/path-operation-advanced-configuration.md

    Et vous pouvez le faire même si le type de données dans la requête n'est pas au format JSON.
    
    Dans cet exemple, nous n'utilisons pas les fonctionnalités de FastAPI pour extraire le schéma JSON des modèles Pydantic ni la validation automatique pour JSON. En fait, nous déclarons le type de contenu de la requête en tant que YAML, et non JSON :
    
    ```Python hl_lines="17-22  24"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 8K bytes
    - Viewed (0)
  10. build-logic/dependency-modules/src/main/kotlin/gradlebuild.dependency-modules.gradle.kts

        JsonReader(source.reader(Charsets.UTF_8)).use { reader ->
            reader.isLenient = true
            return Gson().fromJson(reader)
        }
    }
    
    inline
    fun <reified T> Gson.fromJson(json: JsonReader): T = this.fromJson(json, object : TypeToken<T>() {}.type)
    
    
    abstract class CapabilityRule @Inject constructor(
        val name: String,
        val version: String
    ) : ComponentMetadataRule {
    Plain Text
    - Registered: Wed May 01 11:36:15 GMT 2024
    - Last Modified: Wed Aug 24 23:27:45 GMT 2022
    - 9.1K bytes
    - Viewed (0)
Back to top