woocommerce/remote-specs-validation 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

woocommerce/remote-specs-validation

最新稳定版本:1.0.2

Composer 安装命令:

composer require woocommerce/remote-specs-validation

包简介

Remote specs testing suite

README 文档

README

Installation

composer require woocommerce/remote-specs-validation

Available Schemas

Filename Endpoint Bundle
remote-inbox-notification.json https://woocommerce.com/wp-json/wccom/inbox-notifications/2.0/notifications.json remote-inbox-notification
payment-gateway-suggestions.json https://woocommerce.com/wp-json/wccom/payment-gateway-suggestions/2.0/suggestions.json payment-gateway-suggestions
obw-free-extensions.json https://woocommerce.com/wp-json/wccom/obw-free-extensions/4.0/extensions.json obw-free-extensions
wc-pay-promotions.json https://woocommerce.com/wp-json/wccom/payment-gateway-suggestions/2.0/payment-method/promotions.json wc-pay-promotions
shipping-partner-suggestions.json https://woocommerce.com/wp-json/wccom/shipping-partner-suggestions/2.0/suggestions.json shipping-partner-suggestions

Working with Schema

If it's your first time working with JSON Schema, we highly recommend reading https://json-schema.org/learn/getting-started-step-by-step first.

  1. Open a schema file from schemas directory.
  2. Make changes.
  3. Run ./bin/build schemas/:name-of-schema-file
  4. Bundled schema file will be saved in bundles directory.

Validation Examples

use Automattic\WooCommerce\Tests\RemoteSpecsValidation\RemoteSpecValidator;
$validator = RemoteSpecValidator::create_from_bundle( 'remote-inbox-notification' );

$spec = json_decode( file_get_contents(":your-remote-inbox-noficiation-json") );

$result = $validator->validate( $spec );

if ( !$result->is_valid() ) {
	var_dump( $result->get_errors() );
} else {
	var_dump('everything looks good!');
}

统计信息

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

GitHub 信息

  • Stars: 2
  • Watchers: 73
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2024-02-19