code: def test_doc_summary_and_description(app, client):
      @app.route("/foo")
      @app.doc(summary="summary from doc decorator")
      def foo():
          pass
  
      @app.route("/bar")
      @app.doc(
          summary="summary for bar",
          description="some description for bar",
      )
      def bar():
          pass
  
      rv = client.get("/openapi.json")
      assert rv.status_code == 200
      validate_spec(rv.json)
      assert (
          rv.json["paths"]["/foo"]["get"]["summary"]
          == "summary from doc decorator"
      )
      assert "description" not in rv.json["paths"]["/foo"]["get"]
      assert (
          rv.json["paths"]["/bar"]["get"]["summary"]
          == "summary for bar"
      )
      assert (
          rv.json["paths"]["/bar"]["get"]["description"]
          == "some description for bar"
      )
  
file_path: apiflask/tests/test_decorator_doc.py
imports: import pytest
  from flask.views import MethodView
  from openapi_spec_validator import validate_spec
  from .schemas import CustomHTTPError
  from .schemas import Foo
label_desc: Use image node_id 1 for calling a global function with example usage: test_doc_summary_and_description(app, client) without return types