RFC: enforce method order for one endpoint in the spec

Đang mở
#15 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
flask, openapi, python

Hướng nghiên cứu

Bắt đầu với apispec/core.py và các extension Flask, Tornado, và Bottle được đề cập trong issue; kiểm tra VALID_METHODS và hành vi sắp xếp được thảo luận trong PR #189. Xác định cách mỗi plugin phát ra các method của endpoint, sau đó xác minh bằng các test extension liên quan rằng thứ tự method được yêu cầu được giữ nguyên.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement feedback welcome help wanted

Issue by lafrech
Wednesday Apr 04, 2018 at 13:39 GMT
Originally opened as https://github.com/marshmallow-code/apispec/issues/193


Although json objects are not ordered, some tools respect the order in the OpanAPI json file to display the spec. Therefore, it makes sense to respect the order desired by the user when writing the spec file. Several PRs are based on this assumption (#86, #87, #189).

It could be nice to enforce the order of the methods for each endpoint. For instance, always present the methods in this order:

HTTP_METHODS = ['OPTIONS', 'HEAD', 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'TRACE']

The order list being a module variable, it could be mutated by the user if another order is required.

This feature requires modifications in flask, tornado, and perhaps bottle extensions. More details in https://github.com/marshmallow-code/apispec/pull/189.

Edit: I'd remove 'TRACE' from the list as it is not in VALID_METHODS.

Edit again: OpenAPI 3 contains TRACE (https://github.com/marshmallow-code/apispec/issues/165#issuecomment-388753808).

Ngôn ngữ chính
Python
Star
33
Fork
25
Merge trung bình
6 giờ 59 phút
Pull request đã merge (30 ngày)
7

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của marshmallow-code/apispec-webframeworks

Tất cả issue của marshmallow-code/apispec-webframeworks

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.