-
Notifications
You must be signed in to change notification settings - Fork 9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: improve the xml schema to support CDATA
(the data does not need to be escaped)
#4919
Proposal: improve the xml schema to support CDATA
(the data does not need to be escaped)
#4919
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
XML Objects are not allowed to have a CDATA
field.
If this is changed to use a field named x-cdata
instead, I'd be open to merging it 😄
@shockey the xml |
thanks @TheNorthMemory, I'm looking at whether this could be better suited as a plugin - stay tuned 😄 |
@shockey ops, the xml function was already as a plugin ( |
@TheNorthMemory Following up on this long outstanding PR... There has been subsequent changes to the use of |
Yep, the |
@tim-lai merged, on the top of this PR, it supporting the following display now. The characters are safe and easier readable both on <foo><![CDATA[&bar]]></foo>
<bar><![CDATA[<2]]></bar> |
@TheNorthMemory Thanks for updating! One more request, can you add some notes about usage of this feature to documentation? |
This was the |
I cannot find a right place to document those two implements. I've also quick check the OAI's #1532 where were discussed about the xml's The usage examples here: wechatpay's micropay.request sample: scene_info:
xml:
x-cdata: true
type: string
description: +场景信息
example: '{"store_info" : {"id": "SZTX001","name": "腾大餐厅","area_code": "440305","address": "科技园中一路腾讯大厦" }}'
maxLength: 256
nullable: true wechatpay's querycombinedorder.response sample: - type: object
xml:
name: xml
required:
- sub_order_list
properties:
sub_order_list:
xml:
x-cdata: true
type: string
description: +子单信息
example: '{"order_num": 3,"order_list": [{"appid":"wx2421b1c4370ec43b","mch_id":"1230000109","openid":"oUpF8uMuAJO_M2pxb1Q9zNjWeS6o","total_fee":100,"cash_fee":100,"transaction_id":"4217752501201407033233368018","out_trade_no":"12177525012","attach":"test001","time_end":"20171030133525"},{"appid":"wx2421b1c4370ec43b","mch_id":"1230000109","openid":"oUpF8uMuAJO_M2pxb1Q9zNjWeS6o","sub_appid":"wx2421b1c437055ce","sub_mch_id":"1230000108","sub_openid":"oUp3rfMuAJO_123xb1Q9zNjWedco","trade_type":"JSAPI","total_fee":100,"cash_fee":100,"transaction_id":"4217752501201407033233368018","out_trade_no":"12177525012","attach":"test001","time_end":"20171030133525"},{"appid":"wx2421b1c4370ec43b","mch_id":"1230000109","openid":"oUpF8uMuAJO_M2pxb1Q9zNjWeS6o","trade_type":"JSAPI","total_fee":100,"fee_type":"USD","cash_fee":100,"cash_fee_type":"CNY","transaction_id":"4217752501201407033233368018","out_trade_no":"12177525012","attach":"test001","time_end":"20171030133525","rate_value":"65000000"}]}'
maxLength: 10240 Another one about the
When it's Just placed here. |
@TheNorthMemory Apologies for jumping in this late in the game, but I'm afraid we won't be able to accept the PR. While it's great that spec supports extensions, we have to limit our support for custom extensions in the spec. In rare cases, we may choose to add support for such extensions, if we feel that it makes sense for the general Swagger UI users. Unfortunately, for |
Description
CDATA
feature, see thisadditionalProperties: {}
works same asadditionalProperties: true
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Checklist
My PR contains...
src/
is unmodified: changes to documentation, CI, metadata, etc.)package.json
)My changes...
Documentation
Automated tests