-
-
Save johnjelinek/4e6ae543ba9db596461abc2a93101ac1 to your computer and use it in GitHub Desktop.
Example of failing builder with map as input
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns builderjava.bad | |
(:require [clojure.java.data.builder :as builder]) | |
(:import (software.amazon.awscdk.services.apigateway IntegrationOptions | |
IntegrationOptions$Builder))) | |
(defn build [] | |
(builder/to-java IntegrationOptions (IntegrationOptions/builder) | |
{:request-paramaters {"a" "b"}} | |
{:builder-class IntegrationOptions$Builder})) | |
(build) | |
;; => Execution error (NullPointerException) at sun.reflect.NativeMethodAccessorImpl/invoke0 (NativeMethodAccessorImpl.java:-2). | |
;; null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{:deps {software.amazon.awscdk/apigateway {:mvn/version "1.30.0"} | |
org.clojure/java.data {:mvn/version "1.0.64"}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns builderjava.good | |
(:import software.amazon.awscdk.services.apigateway.IntegrationOptions)) | |
(defn build [] | |
(-> (IntegrationOptions/builder) | |
(.requestParameters {"a" "b"}) | |
(.build))) | |
(build) | |
;; => #object[software.amazon.awscdk.services.apigateway.IntegrationOptions$Jsii$Proxy 0x4ffbb14b "software.amazon.awscdk.services.apigateway.IntegrationOptions$Jsii$Proxy@b43"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment