mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-02 11:30:12 +03:00
generateschema: Add argument help text
This should make things a little clearer for anyone using this tool. Some of this is taken from the OpenAPI specification itself [1]. [1] https://github.com/OAI/OpenAPI-Specification Signed-off-by: Stephen Finucane <stephen@that.guru>
This commit is contained in:
parent
a52692b5b1
commit
db22aa41e0
|
@ -14,13 +14,29 @@ class Command(BaseCommand):
|
|||
help = "Generates configured API schema for project."
|
||||
|
||||
def add_arguments(self, parser):
|
||||
parser.add_argument('--title')
|
||||
parser.add_argument('--url')
|
||||
parser.add_argument('--description')
|
||||
parser.add_argument('--format', choices=['openapi', 'openapi-json', 'corejson'], default='openapi')
|
||||
parser.add_argument(
|
||||
'--title',
|
||||
help='A short description of the application. CommonMark syntax '
|
||||
'MAY be used for rich text representation.')
|
||||
parser.add_argument(
|
||||
'--url',
|
||||
help='A URL to the target host. This URL supports Server '
|
||||
'Variables and MAY be relative, to indicate that the host '
|
||||
'location is relative to the location where the OpenAPI document '
|
||||
'is being served. Variable substitutions will be made when a '
|
||||
'variable is named in {brackets}.')
|
||||
parser.add_argument(
|
||||
'--description',
|
||||
help='An optional string describing the host designated by the '
|
||||
'URL. CommonMark syntax MAY be used for rich text representation.')
|
||||
parser.add_argument(
|
||||
'--format',
|
||||
choices=['openapi', 'openapi-json', 'corejson'], default='openapi',
|
||||
help='Output format.')
|
||||
parser.add_argument(
|
||||
'output',
|
||||
nargs='?', type=argparse.FileType('w'), default=sys.stdout)
|
||||
nargs='?', type=argparse.FileType('w'), default=sys.stdout,
|
||||
help='Path to output file. If not specified, output to stdout')
|
||||
|
||||
def handle(self, *args, **options):
|
||||
assert coreapi is not None, 'coreapi must be installed.'
|
||||
|
|
Loading…
Reference in New Issue
Block a user