Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a25e387

Browse files
SafaAlfulaijsliverc
andauthored
Support tags in OAS schema (#928)
* Suuport openapi tags * Update openapi tests * Update CHANGELOG.md * Update AUTHORS Co-authored-by: Oliver Sauder <sliverc@users.noreply.github.com>
1 parent d5aef4a commit a25e387

File tree

4 files changed

+23
-5
lines changed

4 files changed

+23
-5
lines changed

‎AUTHORS‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Raphael Cohen <raphael.cohen.utt@gmail.com>
3131
René Kälin <rene@matraxi.ch>
3232
Roberto Barreda <roberto.barreda@gmail.com>
3333
Rohith PR <praroh2@gmail.com>
34+
Safa AlFulaij <safa1996alfulaij@gmail.com>
3435
santiavenda <santiavenda2@gmail.com>
3536
Sergey Kolomenkin <https://kolomenkin.com>
3637
Stas S. <stas@nerd.ro>

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ any parts of the framework not mentioned in the documentation should generally b
1313
### Added
1414

1515
* Added support for Django 3.2.
16+
* Added support for tags in OAS schema
1617

1718
### Fixed
1819

‎example/tests/snapshots/snap_test_openapi.py‎

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,10 @@
121121
},
122122
"description": "not found"
123123
}
124-
}
124+
},
125+
"tags": [
126+
"authors"
127+
]
125128
}"""
126129

127130
snapshots[
@@ -227,7 +230,10 @@
227230
},
228231
"description": "not found"
229232
}
230-
}
233+
},
234+
"tags": [
235+
"authors"
236+
]
231237
}"""
232238

233239
snapshots[
@@ -411,7 +417,10 @@
411417
},
412418
"description": "[Conflict](https://jsonapi.org/format/#crud-creating-responses-409)"
413419
}
414-
}
420+
},
421+
"tags": [
422+
"authors"
423+
]
415424
}"""
416425

417426
snapshots[
@@ -589,7 +598,10 @@
589598
},
590599
"description": "[Conflict]([Conflict](https://jsonapi.org/format/#crud-updating-responses-409)"
591600
}
592-
}
601+
},
602+
"tags": [
603+
"authors"
604+
]
593605
}"""
594606

595607
snapshots[
@@ -652,5 +664,8 @@
652664
},
653665
"description": "[Resource does not exist](https://jsonapi.org/format/#crud-deleting-responses-404)"
654666
}
655-
}
667+
},
668+
"tags": [
669+
"authors"
670+
]
656671
}"""

‎rest_framework_json_api/schemas/openapi.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,7 @@ def get_operation(self, path, method):
427427
parameters += self.get_pagination_parameters(path, method)
428428
parameters += self.get_filter_parameters(path, method)
429429
operation["parameters"] = parameters
430+
operation["tags"] = self.get_tags(path, method)
430431

431432
# get request and response code schemas
432433
if method == "GET":

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /