code: def field2read_only(self, field, **kwargs):
          
          attributes = {}
          if field.dump_only:
              attributes["readOnly"] = True
          return attributes
docs: Return the dictionary of OpenAPI field attributes for a dump_only field.
  
          :param Field field: A marshmallow field.
          :rtype: dict