diff --git a/json-spec-openapi.cabal b/json-spec-openapi.cabal
--- a/json-spec-openapi.cabal
+++ b/json-spec-openapi.cabal
@@ -1,6 +1,6 @@
 cabal-version:       3.0
 name:                json-spec-openapi
-version:             1.0.0.0
+version:             1.0.1.0
 synopsis:            json-spec-openapi
 description:
   This package provides a way to produce
diff --git a/src/Data/JsonSpec/OpenApi.hs b/src/Data/JsonSpec/OpenApi.hs
--- a/src/Data/JsonSpec/OpenApi.hs
+++ b/src/Data/JsonSpec/OpenApi.hs
@@ -342,13 +342,13 @@
       & set type_ (Just OpenApiObject)
 instance {- Inlineable defs (JsonLet newDefs spec) -}
     ( Inlineable (Concat newDefs defs) spec
-    , Defs newDefs newDefs
+    , Defs (Concat newDefs defs) newDefs
     )
   =>
     Inlineable defs (JsonLet newDefs spec)
   where
     inlineable = do
-      mkDefs @newDefs @newDefs
+      mkDefs @(Concat newDefs defs) @newDefs
       inlineable @(Concat newDefs defs) @spec
 instance {- Inlineable defs (JsonRef target) -}
     ( Deref defs defs target
diff --git a/test/test.hs b/test/test.hs
--- a/test/test.hs
+++ b/test/test.hs
@@ -287,37 +287,67 @@
         in
           actual `shouldBe` expected
 
-      it "let expression" $
-        let
-          actual :: (Definitions OA.Schema, OA.Schema)
-          actual =
-            toOpenApiSchema (Proxy @(
-              JsonLet '[
-                '("thing", JsonString)
-              ]
-              (
-                JsonObject '[
-                  Required "foo" (JsonRef "thing")
+      describe "let bindings" $ do
+        it "basic let expression" $
+          let
+            actual :: (Definitions OA.Schema, OA.Schema)
+            actual =
+              toOpenApiSchema (Proxy @(
+                JsonLet '[
+                  '("thing", JsonString)
                 ]
+                (
+                  JsonObject '[
+                    Required "foo" (JsonRef "thing")
+                  ]
+                )
+              ))
+
+            expected :: (Definitions OA.Schema, OA.Schema)
+            expected =
+              ( HMI.singleton "thing" stringSchema
+              , mempty
+                  & set OA.type_ (Just OA.OpenApiObject)
+                  & set OA.properties (
+                      mempty
+                        & set (at "foo") (Just (OA.Ref (OA.Reference "thing")))
+                    )
+                  & set OA.required ["foo"]
+                  & set
+                      OA.additionalProperties
+                      (Just (OA.AdditionalPropertiesAllowed False))
               )
-            ))
+          in
+            actual `shouldBe` expected
 
-          expected :: (Definitions OA.Schema, OA.Schema)
-          expected =
-            ( HMI.singleton "thing" stringSchema
-            , mempty
-                & set OA.type_ (Just OA.OpenApiObject)
-                & set OA.properties (
-                    mempty
-                      & set (at "foo") (Just (OA.Ref (OA.Reference "thing")))
+        it "back reference" $
+          let
+            actual :: (Definitions OA.Schema, OA.Schema)
+            actual =
+              toOpenApiSchema (Proxy @(
+                JsonLet
+                 '[ '( "thing1"
+                     , JsonString
+                     )
+                  , '( "thing2"
+                     , JsonRef "thing1"
+                     )
+                  ]
+                  (
+                    JsonRef "thing2"
                   )
-                & set OA.required ["foo"]
-                & set
-                    OA.additionalProperties
-                    (Just (OA.AdditionalPropertiesAllowed False))
-            )
-        in
-          actual `shouldBe` expected
+              ))
+
+            expected :: (Definitions OA.Schema, OA.Schema)
+            expected =
+              ( HMI.fromList
+                  [ ("thing1", stringSchema)
+                  , ("thing2", stringSchema)
+                  ]
+              , stringSchema
+              )
+          in
+            actual `shouldBe` expected
 
       it "top level reference" $
         let
