wolfier opened a new issue, #25492:
URL: https://github.com/apache/airflow/issues/25492

   ### Apache Airflow version
   
   2.3.3 (latest released)
   
   ### What happened
   
   The `/plugins` endpoint returned a 500 http status code.
   
   ```
   curl -X GET http://localhost:8080/api/v1/plugins\?limit\=1  \
      -H 'Cache-Control: no-cache' \
      --user "admin:admin"
   {
     "detail": "\"{'name': 'Test View', 'category': 'Test Plugin', 'view': 
'test.appbuilder_views.TestAppBuilderBaseView'}\" is not of type 
'object'\n\nFailed validating 'type' in 
schema['allOf'][0]['properties']['plugins']['items']['properties']['appbuilder_views']['items']:\n
    {'nullable': True, 'type': 'object'}\n\nOn 
instance['plugins'][0]['appbuilder_views'][0]:\n    (\"{'name': 'Test View', 
'category': 'Test Plugin', 'view': \"\n     
\"'test.appbuilder_views.TestAppBuilderBaseView'}\")",
     "status": 500,
     "title": "Response body does not conform to specification",
     "type": 
"http://apache-airflow-docs.s3-website.eu-central-1.amazonaws.com/docs/apache-airflow/latest/stable-rest-api-ref.html#section/Errors/Unknown";
   }
   ```
   
   ### What you think should happen instead
   
   The response should contain all the plugins integrated with Airflow.
   
   ### How to reproduce
   
   Create a simple plugin in the plugin directory.
   
   `appbuilder_views.py`
   
   ```
   from flask_appbuilder import expose, BaseView as AppBuilderBaseView
   
   
   # Creating a flask appbuilder BaseView
   class TestAppBuilderBaseView(AppBuilderBaseView):
       @expose("/")
       def test(self):
           return self.render_template("test_plugin/test.html", content="Hello 
galaxy!")
   
   ```
   
   `plugin.py`
   
   ```
   from airflow.plugins_manager import AirflowPlugin
   from test.appbuilder_views import TestAppBuilderBaseView
   
   
   class TestPlugin(AirflowPlugin):
       name = "test"
   
       appbuilder_views = [
           {
               "name": "Test View",
               "category": "Test Plugin",
               "view": TestAppBuilderBaseView()
           }
       ]
   
   ```
   
   Call the `/plugin` endpoint.
   
   ```
   curl -X GET http://localhost:8080/api/v1/plugins\?limit\=1  \
      -H 'Cache-Control: no-cache' \
      --user "admin:admin"
   ```
   
   ### Operating System
   
   N/A
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Astronomer
   
   ### Deployment details
   
   _No response_
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to