当前位置:网站首页>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 .
边栏推荐
- [advanced mathematics] [8] differential equation
- Recommendations on how to install plug-ins and baby plug-ins in idea
- [advanced mathematics] [1] function, limit, continuity
- 当AI邂逅生命健康,华为云为他们搭建三座桥
- 【NOI模拟赛】字符串匹配(后缀自动机SAM,莫队,分块)
- [Infographics Show] 248 Public Domain Name
- [today in history] July 15: Mozilla foundation was officially established; The first operation of Enigma cipher machine; Nintendo launches FC game console
- Log in to Baidu online disk with cookies (websites use cookies)
- Configure and install cocos2dx development environment under Tongxin UOS
- 毕业从事弱电3个月,我为什么会选择转行网络工程师
猜你喜欢

随机梯度下降法、牛顿法、冲量法、AdaGrad、RMSprop以及Adam优化过程和理解

Stochastic gradient descent method, Newton method, impulse method, adagrad, rmsprop and Adam optimization process and understanding
![[advanced mathematics] [1] function, limit, continuity](/img/c5/f9fd3814a61d0fba24b37253c7e51c.png)
[advanced mathematics] [1] function, limit, continuity

Export and call of onnx file of pytorch model

Docker builds redis cluster

Sentinel simple current limiting and degradation demo problem record

wallys//wifi6 wifi5 router IPQ6018 IPQ4019 IPQ4029 802.11ax 802.11ac

4everland storage node portal network design
EZDML reverse engineering import database analysis practical operation tutorial
![[advanced mathematics] [8] differential equation](/img/83/b6b07540e3cf6d6433e57447d42ee9.png)
[advanced mathematics] [8] differential equation
随机推荐
JMeter - interface test
Advantages of network virtualization of various manufacturers
4. Server startup of source code analysis of Nacos configuration center
【云原生 | 从零开始学Kubernetes】八、命名空间资源配额以及标签
Apache Mina framework "suggestions collection"
PreScan快速入门到精通第十八讲之PreScan轨迹编辑的特殊功能
Working principle of radar water level gauge and precautions for installation and maintenance
【高等数学】【8】微分方程
[advanced mathematics] [3] Application of differential mean value theorem and derivative
Arrow 之 Parquet
DIY个人服务器(diy存储服务器)
Distributed link logging minbox logging usage document
[today in history] July 1: the father of time-sharing system was born; Alipay launched barcode payment; The first TV advertisement in the world
Docker builds redis cluster
CarSim仿真快速入门(十四)—CarSim-Simulink联合仿真
Apache MINA框架「建议收藏」
【高等数学】【5】定积分及应用
[advanced mathematics] [1] function, limit, continuity
How much memory does bitmap occupy in the development of IM instant messaging?
Timing analysis and constraints based on xlinx (1) -- what is timing analysis? What are temporal constraints? What is temporal convergence?