swagger-converter
swagger-converter copied to clipboard
[BUG]ref error after convertion
ref error after convertion
"openapi": "3.0.1",
"components": {
"schemas": {
"dnsaccountmdl.TRow": {
"type": "object",
"properties": {
"auth_config": {
"type": "object",
"description": "auth config",
"allOf": [{ "$ref": "#/definitions/dnsaccount.TAuthConfig" }]
}
should be
"components": {
"openapi": "3.0.1",
"schemas": {
"dnsaccountmdl.TRow": {
"type": "object",
"properties": {
"auth_config": {
"type": "object",
"description": "auth config",
"allOf": [{ "$ref": "#/components/schemas/dnsaccount.TAuthConfig" }]
}
Same error on this file: HotelBooking_v2_Version_2.0_swagger_specification.json
Is there a way to solve this with some configuration?
I use a fix with a regex and sed meanwhile if anyone is interested:
`if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS
echo "Fixing # macOS $SPECS_DIR/$DEST_DIR/$filename"
sed -i '' 's|"$ref":"#/definitions/|"$ref":"#/components/schemas/|g' "$SPECS_DIR/$DEST_DIR/$filename"
else
# Linux
echo "Fixing # Linux $SPECS_DIR/$DEST_DIR/$filename"
sed -i 's|"$ref":"#/definitions/|"$ref":"#/components/schemas/|g' "$SPECS_DIR/$DEST_DIR/$filename"
fi`