From f7a6fdeb67ab82895eafdc8c054dc63c30589dae Mon Sep 17 00:00:00 2001 From: Ankit Mahato Date: Sat, 6 Apr 2024 18:30:08 +0530 Subject: [PATCH] Fixes --- lib/codegen/ruby/net_http.dart | 27 ++------- test/codegen/ruby_net_http_codegen_test.dart | 60 ++++++++++++++++---- 2 files changed, 55 insertions(+), 32 deletions(-) diff --git a/lib/codegen/ruby/net_http.dart b/lib/codegen/ruby/net_http.dart index d17c0a41..769fa273 100644 --- a/lib/codegen/ruby/net_http.dart +++ b/lib/codegen/ruby/net_http.dart @@ -7,7 +7,7 @@ import 'package:apidash/consts.dart'; class RubyNetHttpCodeGen { String kTemplateStart = """require "uri" require "net/http" -{% if type == "application/json" %}require "json"{% endif %} + url = URI("{{url}}") https = Net::HTTP.new(url.host, url.port) {% if check == "https" %}https.use_ssl = true{% endif %} @@ -22,12 +22,10 @@ request = Net::HTTP::{{method}}.new(url) String kTemplateBody = """ -request.body = JSON.dump({{body}}) -"""; +request.body = <