openapi

Remove default `application/json` header from fastapi response

Remove default `application/json` header from fastapi response Question: I have taken this (https://fastapi.tiangolo.com/advanced/response-directly/#returning-a-custom-response) example from fastapi documentation regarding how to return a custom response from a fastapi application. This is my example code that i came up with to test it : from http.client import responses from fastapi import FastAPI, Response app = FastAPI() response_examples …

Total answers: 1

How to document default None/null in OpenAPI/Swagger using FastAPI?

How to document default None/null in OpenAPI/Swagger using FastAPI? Question: Using a ORM, I want to do a POST request letting some fields with a null value, which will be translated in the database for the default value specified there. The problem is that OpenAPI (Swagger) docs, ignores the default None and still prompts a …

Total answers: 1

Insert local image in the FastAPI automatic documentation

Insert local image in the FastAPI automatic documentation Question: Introduction FastAPI can autogenerate your documentation when you are using FastAPI to create an API. I am trying to insert an image in the description (markdown) of one of my endpoints, but I can’t do it when the image is located in the local hardrive. I …

Total answers: 2

Swagger / OpenAPI spec featuring file upload rejected by Google Endpoints

Swagger / OpenAPI spec featuring file upload rejected by Google Endpoints Question: My goal is to set up a simple API for uploading a file via Google Endpoints. This is my simplified OpenAPI specification which is valid according to Swagger validation: swagger: “2.0” info: title: “JSON Ingester” description: “Receive JSON files, transform and load them.” …

Total answers: 3