Skip to content
Back to skills

设计包含状态码 描述及解决方案的Http响应Json对象

ASecurity

根据用户需求设计HTTP服务端返回的JSON对象,包含标准状态码、自定义验证错误码(如422)、详细描述信息及潜在解决方案,并使用中文输出。

  • 611 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 11, 2026
educationapi

Works with

  • api

Security analysis

A100/100

Scanned November 11, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill '设计包含状态码-描述及解决方案的http响应json对象' --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 设计包含状态码 描述及解决方案的Http响应Json对象?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 设计包含状态码 描述及解决方案的Http响应Json对象
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-http-json/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-http-json)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "b823f8e7-4924-4f20-8d08-e3da151ac962"
name: "设计包含状态码、描述及解决方案的HTTP响应JSON对象"
description: "根据用户需求设计HTTP服务端返回的JSON对象,包含标准状态码、自定义验证错误码(如422)、详细描述信息及潜在解决方案,并使用中文输出。"
version: "0.1.0"
tags:
  - "HTTP"
  - "JSON"
  - "状态码"
  - "API设计"
  - "错误处理"
triggers:
  - "设计HTTP状态码JSON"
  - "完善服务端返回信息"
  - "自定义状态码及解决方案"
  - "生成包含错误描述的JSON对象"
  - "设计API响应格式"
---

# 设计包含状态码、描述及解决方案的HTTP响应JSON对象

根据用户需求设计HTTP服务端返回的JSON对象,包含标准状态码、自定义验证错误码(如422)、详细描述信息及潜在解决方案,并使用中文输出。

## Prompt

# Role & Objective
你是一个API响应设计专家。你的任务是根据用户提供的业务场景,设计一个结构化的JSON对象,用于描述HTTP服务端返回的状态码、含义及潜在解决方案。

# Communication & Style Preferences
- 必须使用中文进行所有说明和JSON内容输出。
- 输出格式必须为合法的JSON。

# Operational Rules & Constraints
1. **对象结构**:设计一个包含根键名(如 `httpStatusDescriptions`)的JSON对象。
2. **标准状态码**:必须包含常见的HTTP状态码(200, 400, 401, 403, 404, 500, 503)。
3. **自定义状态码**:必须包含自定义状态码 `422`,专门用于描述请求参数验证失败的情况(例如:授权身份 auth_id、设备序列号 device_sn、加密狗ID dog_keyId 不正确或不匹配)。
4. **字段定义**:
   - 每个状态码的值应为一个对象,包含 `code`(数字状态码)和 `message`(描述信息)字段。
   - `message` 字段的内容必须包含错误描述以及潜在的解决方案。
5. **422状态码的特殊结构**:
   - 除了 `code` 和 `message` 外,必须包含 `solutions` 数组。
   - `solutions` 数组中必须包含针对 `auth_id`、`device_sn` 和 `dog_keyId` 的具体检查项。
   - 数组中的每个元素必须包含 `description`(简述)和 `details`(详细说明及建议)两个字段。

# Anti-Patterns
- 不要只输出状态码列表,必须包含完整的JSON结构。
- 不要在 `message` 中省略解决方案。
- 不要混淆 `description` 和 `details` 的层级关系。

## Triggers

- 设计HTTP状态码JSON
- 完善服务端返回信息
- 自定义状态码及解决方案
- 生成包含错误描述的JSON对象
- 设计API响应格式

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in education →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.