当前位置:网站首页>Chapter VI modified specification (SPEC) class
Chapter VI modified specification (SPEC) class
2022-07-25 20:18:00 【yaoxin521123】
List of articles
Chapter six Modify specifications (SPEC) class
summary
The following table lists the reasons for modifying the specification class and briefly summarizes the changes required :
| reason | change |
|---|---|
| Update or replace specifications | Manually modify OpenAPI XData Block or by regenerating the canonical class . |
Enable REST Services to support CORS | Manually modify OpenAPI XData block ; Also add a class parameter and create a custom scheduling superclass . |
Enable REST Services to support Web conversation | Add class parameters . |
| Specify the permissions required to use the endpoint | Manually modify OpenAPI XData block . |
| Override the default content type 、 Response character set or input stream processing | Add class parameters . |
| Specify a non default name for the service method | Manually modify OpenAPI XData block . |
Whenever you compile a specification class , The compiler will regenerate the scheduling class and update the implementation class in the same package .
Cover content types 、 Response character set or input stream processing
Just add class parameters to the canonical class and recompile , Can be covered REST Several key aspects of service .
- By default ,
RESTService needsapplication/jsonContent type . Do you want to overwrite it , Please add the following to the specification class :
Parameter CONTENTTYPE = "some-content-type";
among some-content-type yes MIME Content type .
- By default ,
RESTThe response message of the service adoptsUTF-8Format . Do you want to overwrite it , Please add the following to the specification class :
Parameter CHARSET = "some-character-set";
among some-content-type-here Is the name of the character set .
- By default ,
RESTThe service converts the input character stream toUnicode. How about this , Please add the following to the specification class :
Parameter CONVERTINPUTSTREAM = 0";
Then recompile . Then copy these changes to the scheduling class .
Override the name of the service method
By default , Compiler uses operation operationId To determine the corresponding REST The name of the method called . You can specify different names . So , Please add the following content to the specification class OpenAPI XData Operation in block :
"x-ISC_ServiceMethod":"alternatename"
Example
"/pets":{
"get":{
"description":"Returns all pets from the system that the user has access to",
"operationId":"findPets",
"x-ISC_ServiceMethod":"ReturnPets",
"produces":[
"application/json",
"application/xml",
"text/xml",
"text/html"
],
Then recompile . Then the compiler adds this new method to the scheduling and implementation classes . Be sure to edit the implementation class and provide an implementation for this new method .
边栏推荐
- 03 isomorphism of tree 1
- 4、Nacos 配置中心源码解析之 服务端启动
- PreScan快速入门到精通第十九讲之PreScan执行器配置、轨迹同步及非配多个轨迹
- 从瞳代到“瞳代”再到品牌,暴利的美瞳的变与未变
- PMP practice once a day | don't get lost in the exam -7.25
- tga文件格式(波形声音文件格式)
- Array of sword finger offer question bank summary (I) (C language version)
- 飞行器pid控制(旋翼飞控)
- Do you still have certificates to participate in the open source community?
- Socket error Event: 32 Error: 10053. Connection closing...Socket close
猜你喜欢
![Summarize the level of intelligent manufacturing discussion [macro understanding]](/img/84/3addabdf857c562535a4085782d3e8.png)
Summarize the level of intelligent manufacturing discussion [macro understanding]

增加 swap 空间

Rainbow plug-in extension: monitor MySQL based on MySQL exporter

03 isomorphism of tree 1
![[today in history] July 8: PostgreSQL release; SUSE acquires the largest service provider of k8s; Activision Blizzard merger](/img/14/f2b68dbe4e6a9b8d89ed9ff38f5e11.png)
[today in history] July 8: PostgreSQL release; SUSE acquires the largest service provider of k8s; Activision Blizzard merger

【云原生 | 从零开始学Kubernetes】八、命名空间资源配额以及标签

JMeter - interface test
EZDML reverse engineering import database analysis practical operation tutorial

Jmeter——接口测试

4、Nacos 配置中心源码解析之 服务端启动
随机推荐
【云原生 | 从零开始学Kubernetes】八、命名空间资源配额以及标签
4everland storage node portal network design
Can you tell me whether mindspore supports torchvision Model directly uses the pre trained network, such as vgg16
RepVGG网络中重参化网络结构解读【附代码】
各厂商网络虚拟化的优势
wallys//IPQ5018/IPQ6010/PD-60 802.3AT Input Output 10/100/1000M
CarSim simulation quick start (16) - ADAS sensor objects of CarSim sensor simulation (2)
【高等数学】【6】多元函数微分学
[advanced mathematics] [4] indefinite integral
Rainbow plug-in extension: monitor MySQL based on MySQL exporter
Deeplobv1 and V2
[today in history] July 19: the father of IMAP agreement was born; Project kotlin made a public appearance; New breakthroughs in CT imaging
wallys//wifi6 wifi5 router IPQ6018 IPQ4019 IPQ4029 802.11ax 802.11ac
Distributed link logging minbox logging usage document
QQ是32位还是64位软件(在哪看电脑是32位还是64位)
JVM (XXIII) -- JVM runtime parameters
QML combines qsqltablemodel to dynamically load data MVC "recommended collection"
9.< tag-动态规划和子序列, 子数组>lt.718. 最长重复子数组 + lt.1143. 最长公共子序列
Timing analysis and constraints based on xlinx (1) -- what is timing analysis? What are temporal constraints? What is temporal convergence?
Successfully solved typeerror: a bytes like object is required, not 'str‘