()
| 67 | |
| 68 | @plugin_config.route("/openapi.yaml") |
| 69 | def openapi_yaml(): |
| 70 | current_domain = request.host_url |
| 71 | return f"""components: |
| 72 | schemas: |
| 73 | CensusResponse: |
| 74 | properties: |
| 75 | answer: |
| 76 | description: the answer to the question |
| 77 | type: string |
| 78 | sql_query: |
| 79 | description: the sql query that generated the answer |
| 80 | type: string |
| 81 | type: object |
| 82 | info: |
| 83 | description: Data from the US Census |
| 84 | title: Census Data |
| 85 | version: '1.0' |
| 86 | openapi: 3.0.2 |
| 87 | paths: |
| 88 | /plugin/get_census_data: |
| 89 | get: |
| 90 | consumes: |
| 91 | - application/json |
| 92 | description: Provide census data for questions about populations and other location |
| 93 | information. This provides data from the 2020 census. |
| 94 | operationId: getCensusData |
| 95 | parameters: |
| 96 | - description: the question to ask the census data |
| 97 | in: query |
| 98 | name: question |
| 99 | required: false |
| 100 | schema: |
| 101 | type: string |
| 102 | responses: |
| 103 | default: |
| 104 | description: '' |
| 105 | schema: |
| 106 | $ref: '#/components/schemas/CensusResponse' |
| 107 | tags: |
| 108 | - Census Data |
| 109 | options: |
| 110 | consumes: |
| 111 | - application/json |
| 112 | description: Provide census data for questions about populations and other location |
| 113 | information. This provides data from the 2020 census. |
| 114 | operationId: getCensusData |
| 115 | parameters: |
| 116 | - description: the question to ask the census data |
| 117 | in: query |
| 118 | name: question |
| 119 | required: false |
| 120 | schema: |
| 121 | type: string |
| 122 | responses: |
| 123 | default: |
| 124 | description: '' |
| 125 | schema: |
| 126 | $ref: '#/components/schemas/CensusResponse' |
nothing calls this directly
no outgoing calls
no test coverage detected