定制 myparcelcom/api-specification 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

myparcelcom/api-specification

Composer 安装命令:

composer require myparcelcom/api-specification

包简介

MyParcel.com API specification based on the OpenAPI Specification.

README 文档

README

Packagist OpenAPI Specification

Description of the API specification used by MyParcel.com located at https://api-specification.myparcel.com. This specification adheres to the OpenApi 3.1 specification and implements the JSON API specification.

Content

Installation

The repository provides Docker containers to validate and preview the spec before committing changes. This is also used when validating pull requests. To install Docker, follow the steps in the documentation.

To set up the project for development run:

./mp.sh setup

Commands

./mp.sh up - Start the containers which will start a server to watch file changes and reload automatically.

./mp.sh down - Stop the containers.

./mp.sh validate - Validate the specification.

NOTE: The validator only works when the containers are already running. Don't forget to start them.

Conventions

Conventions based on the Swagger and JSON Schema specs.

Our internal conventions are described below.

PUT, POST, PATCH

To avoid discussion, the use of the above HTTP methods is described below.

PUT

  • Used to create or replace a resource.
  • Always returns the same response on repeated requests.
  • Needs the full resource for the request (including the id for the to be created or replaced resource).

POST

  • Used to create a resource.
  • Does not return the same response on repeated requests.
  • Does not need the full resource for the request (often does not need the id for the to be created resource).

PATCH

  • Used to update an existing resource.
  • Does not return the same response on repeated requests.
  • Does not need the full resource for the request (you might only want to update a user's name for example).

API versioning

The API versioning follows semantic versioning. The increment in version number is done manually and should be part of the pull request.

Schema file naming

Definition file names follow PascalCasing. Where every first letter of a word (including the first word) is uppercase. For example, the definition for a country code would be found in:

specification/schemas/CountryCode.json

Path file naming

The files in specification/paths are named after their corresponding API endpoints. Where resources start with an uppercase letter and path variables with a lowercase letter. For example, the definition of the following route:

carriers/{carrier_id}/services

can be found in:

specification/paths/Carriers-carrier_id-Services.json

Parameter file naming

Parameter file names are prefixed with the corresponding parameter type. A path parameter for carrier_id would get the following file path:

specification/parameters/path-carrier_id.json

Unique parameters can just remain in the path file and do not need to be extracted to their own files.

License

All software by MyParcel.com is licensed under the MyParcel.com general terms and conditions.

统计信息

  • 总下载量: 16.62k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 3
  • Forks: 2
  • 开发语言: JavaScript

其他信息

  • 授权协议: Unknown
  • 更新时间: 2018-02-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固