Skip to content

Instantly share code, notes, and snippets.

@hashlash
Created March 11, 2022 03:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hashlash/b7bc1b91b42625c6ac5ce7344299d8c7 to your computer and use it in GitHub Desktop.
Save hashlash/b7bc1b91b42625c6ac5ce7344299d8c7 to your computer and use it in GitHub Desktop.
DRF bug SafeString help_text
openapi: 3.0.2
info:
title: Your Project
version: 1.0.0
description: "API for all things \u2026"
paths:
/example-model/:
get:
operationId: listExampleModels
description: Concrete view for listing a queryset or creating a model instance.
parameters: []
responses:
'200':
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Example'
description: ''
tags:
- example-model
post:
operationId: createExampleModel
description: Concrete view for listing a queryset or creating a model instance.
parameters: []
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Example'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/Example'
multipart/form-data:
schema:
$ref: '#/components/schemas/Example'
responses:
'201':
content:
application/json:
schema:
$ref: '#/components/schemas/Example'
description: ''
tags:
- example-model
components:
schemas:
Example:
type: object
properties:
id:
type: integer
readOnly: true
field:
type: string
description: !!python/object/new:django.utils.safestring.SafeString
- <ul><li>info a</li><li>info b</li></ul>
required:
- field
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment