code: def test_doc_summary_and_description_with_methodview(app, client):
      @app.route("/baz")
      class Baz(MethodView):
          @app.doc(summary="summary from doc decorator")
          def get(self):
              pass
  
          @app.doc(
              summary="summary for baz",
              description="some description for baz",
          )
          def post(self):
              pass
  
      rv = client.get("/openapi.json")
      assert rv.status_code == 200
      validate_spec(rv.json)
      assert (
          rv.json["paths"]["/baz"]["get"]["summary"]
          == "summary from doc decorator"
      )
      assert "description" not in rv.json["paths"]["/baz"]["get"]
      assert (
          rv.json["paths"]["/baz"]["post"]["summary"]
          == "summary for baz"
      )
      assert (
          rv.json["paths"]["/baz"]["post"]["description"]
          == "some description for baz"
      )
  
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 2 for calling a global function with example usage: test_doc_summary_and_description_with_methodview(app, client) without return types