openAPI.json 中 XML 的 JSON 模式

问题描述

以下是 JSON 架构

{
  "main": "node_modules/expo/AppEntry.js","scripts": {
    "start": "expo start","android": "expo start --android","ios": "expo start --ios","web": "expo start --web","eject": "expo eject","test": "jest --watchAll"
  },"jest": {
    "preset": "jest-expo"
  },"dependencies": {
    "@apollo/client": "^3.3.21","@eva-design/eva": "^2.0.0","@expo-google-fonts/dev": "^0.1.0","@expo-google-fonts/lato": "^0.1.0","@expo/vector-icons": "^12.0.0","@expo/webpack-config": "~0.12.63","@fingerprintjs/fingerprintjs": "^3.2.0","@react-native-async-storage/async-storage": "~1.15.0","@react-native-community/masked-view": "0.1.10","@react-native-community/netinfo": "6.0.0","@react-navigation/bottom-tabs": "^5.11.2","@react-navigation/native": "^5.9.4","@react-navigation/stack": "^5.12.8","@types/javascript-time-ago": "^2.0.2","@types/jwt-decode": "^3.1.0","@types/lodash": "^4.14.171","@types/luxon": "^1.27.1","@types/uuid": "^8.3.1","@ui-kitten/components": "^5.1.0","@ui-kitten/eva-icons": "^5.1.0","class-validator": "^0.13.1","dotenv": "^8.2.0","expo": "^42.0.0","expo-app-loading": "^1.1.2","expo-auth-session": "~3.3.1","expo-battery": "~5.0.0","expo-constants": "~11.0.1","expo-device": "~3.3.0","expo-font": "~9.2.1","expo-intent-launcher": "~9.1.0","expo-linking": "~2.3.1","expo-localization": "~10.2.0","expo-location": "~12.1.2","expo-notifications": "~0.12.2","expo-permissions": "~12.1.1","expo-random": "~11.2.0","expo-secure-store": "~10.2.0","expo-splash-screen": "~0.11.2","expo-task-manager": "~9.2.2","expo-updates": "~0.8.0","expo-web-browser": "~9.2.0","fingerprintjs2": "^2.1.4","graphql": "^15.5.1","i18next": "^19.8.4","javascript-time-ago": "^2.3.7","jwt-decode": "^3.1.2","lodash": "^4.17.21","luxon": "^1.25.0","react": "16.13.1","react-dom": "16.13.1","react-i18next": "^11.11.1","react-native": "https://github.com/expo/react-native/archive/sdk-42.0.0.tar.gz","react-native-advertising-id": "^1.0.11","react-native-appearance": "~0.3.3","react-native-calendars": "^1.1264.0","react-native-elements": "^3.4.2","react-native-flags": "^1.0.0","react-native-gesture-handler": "~1.10.2","react-native-get-random-values": "~1.7.0","react-native-paper": "^4.9.2","react-native-reanimated": "~2.2.0","react-native-safe-area-context": "3.2.0","react-native-screens": "~3.4.0","react-native-svg": "12.1.1","react-native-vector-icons": "^7.1.0","react-native-web": "~0.13.12","react-refresh": "^0.8.3","uuid": "^8.3.2"
  },"devDependencies": {
    "@expo/ngrok": "^2.5.0","@types/react": "~16.9.35","@types/react-native": "~0.63.2","file-loader": "^6.2.0","react-devtools": "^4.13.5","typescript": "~4.0.0"
  },"private": true
}

以下是在 swagger-editor 中创建的 json 对象。这正是我想要的

schema:
  required: true
  title: number
  properties:
  number:
    type: string
    xml:
    name: number

问题是生成的xml结构:

{"number": "string"} 

我想要的是以下内容:

<?xml version="1.0" encoding="UTF-8"?>
<number>
    <number>string</number>
</number>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)