Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 884 for orjson (0.04 seconds)

  1. fastapi/responses.py

        and the
        [FastAPI docs for Response Model](https://fastapi.tiangolo.com/tutorial/response-model/).
    
        **Note**: `orjson` is not included with FastAPI and must be installed
        separately, e.g. `pip install orjson`.
        """
    
        def render(self, content: Any) -> bytes:
            assert orjson is not None, "orjson must be installed to use ORJSONResponse"
            return orjson.dumps(
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Mar 01 09:21:52 GMT 2026
    - 3.6K bytes
    - Click Count (0)
  2. docs_src/custom_response/tutorial009c_py310.py

    from typing import Any
    
    import orjson
    from fastapi import FastAPI, Response
    
    app = FastAPI()
    
    
    class CustomORJSONResponse(Response):
        media_type = "application/json"
    
        def render(self, content: Any) -> bytes:
            assert orjson is not None, "orjson must be installed"
            return orjson.dumps(content, option=orjson.OPT_INDENT_2)
    
    
    @app.get("/", response_class=CustomORJSONResponse)
    async def main():
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 451 bytes
    - Click Count (0)
  3. tests/test_default_response_class.py

    from typing import Any
    
    import orjson
    from fastapi import APIRouter, FastAPI
    from fastapi.responses import HTMLResponse, JSONResponse, PlainTextResponse
    from fastapi.testclient import TestClient
    
    
    class ORJSONResponse(JSONResponse):
        media_type = "application/x-orjson"
    
        def render(self, content: Any) -> bytes:
            return orjson.dumps(content)
    
    
    class OverrideResponse(JSONResponse):
        media_type = "application/x-override"
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Mar 01 20:49:20 GMT 2020
    - 5.2K bytes
    - Click Count (0)
  4. docs/en/docs/reference/responses.md

    ::: fastapi.responses.UJSONResponse
        options:
            members:
                - charset
                - status_code
                - media_type
                - body
                - background
                - raw_headers
                - render
                - init_headers
                - headers
                - set_cookie
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Feb 22 16:34:59 GMT 2026
    - 4.4K bytes
    - Click Count (0)
  5. tests/test_deprecated_responses.py

            response = client.get("/items")
        assert response.status_code == 200
        assert response.json() == {"name": "widget", "price": 9.99}
    
    
    def test_orjson_response_emits_deprecation_warning():
        with pytest.warns(FastAPIDeprecationWarning, match="ORJSONResponse is deprecated"):
            ORJSONResponse(content={"hello": "world"})
    
    
    # UJSON
    
    
    def _make_ujson_app() -> FastAPI:
        with warnings.catch_warnings():
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Feb 22 16:34:59 GMT 2026
    - 2K bytes
    - Click Count (0)
  6. internal/logger/target/console/console.go

    func (c *Target) Send(e any) error {
    	entry, ok := e.(log.Entry)
    	if !ok {
    		return fmt.Errorf("Uexpected log entry structure %#v", e)
    	}
    	if logger.IsJSON() {
    		logJSON, err := json.Marshal(&entry)
    		if err != nil {
    			return err
    		}
    		fmt.Fprintln(c.output, string(logJSON))
    		return nil
    	}
    
    	if entry.Level == logger.EventKind {
    		fmt.Fprintln(c.output, entry.Message)
    		return nil
    	}
    
    Created: Sun Apr 05 19:28:12 GMT 2026
    - Last Modified: Fri Aug 29 02:39:48 GMT 2025
    - 3.9K bytes
    - Click Count (0)
  7. src/main/java/org/codelibs/fess/app/web/api/admin/backup/ApiAdminBackupAction.java

        }
    
        /**
         * Retrieves a list of available backup files.
         *
         * @return JSON response with backup file list
         */
        // GET /api/admin/backup/files
        @Execute
        public JsonResponse<ApiResult> files() {
            final List<Map<String, String>> list = getBackupItems();
            return asJson(new ApiBackupFilesResponse().files(list).total(list.size()).status(ApiResult.Status.OK).result());
        }
    
        /**
    Created: Tue Mar 31 13:07:34 GMT 2026
    - Last Modified: Thu Jul 17 08:28:31 GMT 2025
    - 6.6K bytes
    - Click Count (0)
  8. src/main/java/org/codelibs/fess/app/web/api/admin/dict/kuromoji/ApiAdminDictKuromojiAction.java

         * @param dictId the dictionary ID
         * @param id the ID of the Kuromoji item to retrieve
         * @return JSON response containing the Kuromoji dictionary item
         */
        // GET /api/admin/dict/kuromoji/setting/{dictId}/{id}
        @Execute
        public JsonResponse<ApiResult> get$setting(final String dictId, final long id) {
            return asJson(new ApiResult.ApiConfigResponse()
    Created: Tue Mar 31 13:07:34 GMT 2026
    - Last Modified: Thu Aug 07 03:06:29 GMT 2025
    - 9.4K bytes
    - Click Count (0)
  9. src/main/java/org/codelibs/fess/app/web/api/admin/dict/protwords/ApiAdminDictProtwordsAction.java

         *
         * @param dictId identifier of the dictionary
         * @param id identifier of the entry
         * @return JSON response containing the entry
         */
        // GET /api/admin/dict/protwords/setting/{dictId}/{id}
        @Execute
        public JsonResponse<ApiResult> get$setting(final String dictId, final long id) {
            return asJson(new ApiResult.ApiConfigResponse()
    Created: Tue Mar 31 13:07:34 GMT 2026
    - Last Modified: Thu Aug 07 03:06:29 GMT 2025
    - 9.4K bytes
    - Click Count (0)
  10. src/main/java/org/codelibs/fess/app/web/api/admin/user/ApiAdminUserAction.java

         * Retrieves a specific user setting by ID.
         *
         * @param id the ID of the user setting to retrieve
         * @return JSON response containing the user setting
         */
        // GET /api/admin/user/setting/{id}
        @Execute
        public JsonResponse<ApiResult> get$setting(final String id) {
            return asJson(new ApiResult.ApiConfigResponse().setting(userService.getUser(id).map(this::createEditBody).orElseGet(() -> {
    Created: Tue Mar 31 13:07:34 GMT 2026
    - Last Modified: Mon Nov 24 02:07:40 GMT 2025
    - 7.8K bytes
    - Click Count (0)
Back to Top