# How do I store Stripe's OpenAPI JSON file (Which is highly unstructured JSON file) on weaviate?

**URL:** <https://forum.weaviate.io/t/how-do-i-store-stripes-openapi-json-file-which-is-highly-unstructured-json-file-on-weaviate/167>\
**Category:** General\
**Created:** [June 12, 2023, 6:24am UTC](https://forum.weaviate.io/t/how-do-i-store-stripes-openapi-json-file-which-is-highly-unstructured-json-file-on-weaviate/167 "2023-06-12T06:24:00Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vruti\_Dobariya](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/vruti_dobariya/32/145_2.png) [@Vruti\_Dobariya](https://forum.weaviate.io/u/Vruti_Dobariya)\
**Post date:** [June 12, 2023, 6:24am UTC](https://forum.weaviate.io/t/how-do-i-store-stripes-openapi-json-file-which-is-highly-unstructured-json-file-on-weaviate/167/1 "2023-06-12T06:24:01Z")

</div>

The file is huge and contains nested JSON which is difficult to upload on Weaviate.

---

<div class="post-metadata">

**Author:** ![jphwang](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/jphwang/32/38_2.png) [@jphwang](https://forum.weaviate.io/u/jphwang)\
**Post date:** [June 12, 2023, 6:41pm UTC](https://forum.weaviate.io/t/how-do-i-store-stripes-openapi-json-file-which-is-highly-unstructured-json-file-on-weaviate/167/2 "2023-06-12T18:41:22Z")

</div>

Hi @Vruti_Dobariya - it depends on what you want to do with it.

For example, if you were going to turn it into one vector, you could stringify it and save it that way. It will vectorize fine, and you could potentially use the Weaviate string filters with it. Would that work for your use case?

---

<div class="post-metadata">

**Author:** ![Vruti\_Dobariya](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/vruti_dobariya/32/145_2.png) [@Vruti\_Dobariya](https://forum.weaviate.io/u/Vruti_Dobariya)\
**Post date:** [June 13, 2023, 8:14am UTC](https://forum.weaviate.io/t/how-do-i-store-stripes-openapi-json-file-which-is-highly-unstructured-json-file-on-weaviate/167/4 "2023-06-13T08:14:45Z")

</div>

Thanks for replying!  
I want to store the JSON content there and vectorize it and ultimately perform a vector search on it.

---

<div class="post-metadata">

**Author:** ![jphwang](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/jphwang/32/38_2.png) [@jphwang](https://forum.weaviate.io/u/jphwang)\
**Post date:** [June 13, 2023, 9:46am UTC](https://forum.weaviate.io/t/how-do-i-store-stripes-openapi-json-file-which-is-highly-unstructured-json-file-on-weaviate/167/5 "2023-06-13T09:46:02Z")

</div>

Okay. Are you storing a bunch of different OpenAPI specs? Or do you want to search through the one (Stripe) OpenAPI spec?

If you are storing a bunch of different OpenAPI specs and find similar ones, you can store the whole spec as one string.

On the other hand, if you want to search through the one spec, then you will have to split it into bits that you want to find.

---

<div class="post-metadata">

**Author:** ![Vruti\_Dobariya](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/vruti_dobariya/32/145_2.png) [@Vruti\_Dobariya](https://forum.weaviate.io/u/Vruti_Dobariya)\
**Post date:** [June 13, 2023, 10:22am UTC](https://forum.weaviate.io/t/how-do-i-store-stripes-openapi-json-file-which-is-highly-unstructured-json-file-on-weaviate/167/6 "2023-06-13T10:22:07Z")

</div>

I am storing only Stripe’s. And the problem arose because it is highly nested so to divide it will be a very difficult task.

---

<div class="post-metadata">

**Author:** ![felixthekraut](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/felixthekraut/32/134_2.png) [@felixthekraut](https://forum.weaviate.io/u/felixthekraut)\
**Post date:** [June 13, 2023, 11:43am UTC](https://forum.weaviate.io/t/how-do-i-store-stripes-openapi-json-file-which-is-highly-unstructured-json-file-on-weaviate/167/7 "2023-06-13T11:43:36Z")

</div>

What is your use case? Hard to make recommendations without knowing what your end goal is.

---

<div class="post-metadata">

**Author:** ![Vruti\_Dobariya](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/vruti_dobariya/32/145_2.png) [@Vruti\_Dobariya](https://forum.weaviate.io/u/Vruti_Dobariya)\
**Post date:** [June 13, 2023, 12:05pm UTC](https://forum.weaviate.io/t/how-do-i-store-stripes-openapi-json-file-which-is-highly-unstructured-json-file-on-weaviate/167/8 "2023-06-13T12:05:49Z")

</div>

I want to perform semantic search on this data. To create personal auto gpt of Stripe API services.

---

<div class="post-metadata">

**Author:** ![felixthekraut](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/felixthekraut/32/134_2.png) [@felixthekraut](https://forum.weaviate.io/u/felixthekraut)\
**Post date:** [June 13, 2023, 12:08pm UTC](https://forum.weaviate.io/t/how-do-i-store-stripes-openapi-json-file-which-is-highly-unstructured-json-file-on-weaviate/167/9 "2023-06-13T12:08:15Z")

</div>

I would chunk your input by route then and embed each separately. I have had good success building API help bots this way.

---

<div class="post-metadata">

**Author:** ![Vruti\_Dobariya](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/vruti_dobariya/32/145_2.png) [@Vruti\_Dobariya](https://forum.weaviate.io/u/Vruti_Dobariya)\
**Post date:** [June 13, 2023, 12:09pm UTC](https://forum.weaviate.io/t/how-do-i-store-stripes-openapi-json-file-which-is-highly-unstructured-json-file-on-weaviate/167/10 "2023-06-13T12:09:44Z")

</div>

Yes. I am trying to do it that way. Thank you for your help!

---

<div class="post-metadata">

**Author:** ![Vruti\_Dobariya](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/vruti_dobariya/32/145_2.png) [@Vruti\_Dobariya](https://forum.weaviate.io/u/Vruti_Dobariya)\
**Post date:** [June 14, 2023, 11:16am UTC](https://forum.weaviate.io/t/how-do-i-store-stripes-openapi-json-file-which-is-highly-unstructured-json-file-on-weaviate/167/11 "2023-06-14T11:16:07Z")

</div>

Why can’t I define a class inside a class while defining the Weaviate schema?

---

<div class="post-metadata">

**Author:** ![jphwang](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/jphwang/32/38_2.png) [@jphwang](https://forum.weaviate.io/u/jphwang)\
**Post date:** [June 14, 2023, 6:28pm UTC](https://forum.weaviate.io/t/how-do-i-store-stripes-openapi-json-file-which-is-highly-unstructured-json-file-on-weaviate/167/12 "2023-06-14T18:28:13Z")

</div>

Hi @Vruti_Dobariya classes aren’t configured to allow that - each class is like a SQL table, so just like you can’t have nested tables, you can’t have nested classes.

You can cross-reference them though. Does that help? ([Cross-references | Weaviate - vector database](https://weaviate.io/developers/weaviate/manage-data/cross-references))

---

<div class="post-metadata">

**Author:** ![Vruti\_Dobariya](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/vruti_dobariya/32/145_2.png) [@Vruti\_Dobariya](https://forum.weaviate.io/u/Vruti_Dobariya)\
**Post date:** [June 22, 2023, 10:19am UTC](https://forum.weaviate.io/t/how-do-i-store-stripes-openapi-json-file-which-is-highly-unstructured-json-file-on-weaviate/167/13 "2023-06-22T10:19:18Z")

</div>

Thanks @jphwang this problem was solved! However, I have one other doubt.

---

<div class="post-metadata">

**Author:** ![Vruti\_Dobariya](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/vruti_dobariya/32/145_2.png) [@Vruti\_Dobariya](https://forum.weaviate.io/u/Vruti_Dobariya)\
**Post date:** [June 22, 2023, 10:22am UTC](https://forum.weaviate.io/t/how-do-i-store-stripes-openapi-json-file-which-is-highly-unstructured-json-file-on-weaviate/167/14 "2023-06-22T10:22:08Z")

</div>

I am using generative search and I am gathering response over the list of elements:

```auto
for string in my_list:
    response = (
        client.query
        .get("StripeAPI", ["path", "key", "value", "dataType"])
        .with_limit(1123)
        .with_where({
            "path": ["path"],
            "operator": "Equal",
            "valueText": string
        })
        .do()
    )
   print(len(response['data']['Get']['StripeAPI']))

```

Here is the snippet.  
Here, in the list of strings that I am traversing over, the first string returns 1123 objects i.e. the max number of objects. But, that string, only has 1054 objects. The problem remains the same even when I change the max limit. How do I solve it?

---

<div class="post-metadata">

**Author:** ![jphwang](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/jphwang/32/38_2.png) [@jphwang](https://forum.weaviate.io/u/jphwang)\
**Post date:** [June 30, 2023, 4:47pm UTC](https://forum.weaviate.io/t/how-do-i-store-stripes-openapi-json-file-which-is-highly-unstructured-json-file-on-weaviate/167/15 "2023-06-30T16:47:23Z")

</div>

Hi @Vruti_Dobariya - sorry for the late reply, I’ve been away for a few days. Can you help me understand the question better?

Could you clarify what you mean when you say this?

> the first string returns 1123 objects i.e. the max number of objects. But, that string, only has 1054 objects

If you mean that regardless of the input, it’s returning the same number of hits as the `limit`, that is the expected behaviour.

Given that this is a vector search, all objects are “similar” to some degree. So Weaviate will return the `n` best matching objects. If I’m misunderstanding the question, please let me know.

---

<div class="post-metadata">

**Author:** ![Vruti\_Dobariya](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/vruti_dobariya/32/145_2.png) [@Vruti\_Dobariya](https://forum.weaviate.io/u/Vruti_Dobariya)\
**Post date:** [July 3, 2023, 7:09am UTC](https://forum.weaviate.io/t/how-do-i-store-stripes-openapi-json-file-which-is-highly-unstructured-json-file-on-weaviate/167/16 "2023-07-03T07:09:09Z")

</div>

Hey, @jphwang. Yes. So, there was a glitch where, regardless of the number of objects present in a string, for the first string, it would generate 1123 objects, i.e., the maximum limit. But it was solved automatically without any changes once I reran my Docker instance. Thanks.

---

<div class="post-metadata">

**Author:** ![jphwang](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/jphwang/32/38_2.png) [@jphwang](https://forum.weaviate.io/u/jphwang)\
**Post date:** [July 3, 2023, 3:41pm UTC](https://forum.weaviate.io/t/how-do-i-store-stripes-openapi-json-file-which-is-highly-unstructured-json-file-on-weaviate/167/17 "2023-07-03T15:41:10Z")

</div>

Fantastic! Glad to hear it’s been resolved 🙂

---

<div class="post-metadata">

**Author:** ![Vruti\_Dobariya](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/vruti_dobariya/32/145_2.png) [@Vruti\_Dobariya](https://forum.weaviate.io/u/Vruti_Dobariya)\
**Post date:** [July 5, 2023, 12:55pm UTC](https://forum.weaviate.io/t/how-do-i-store-stripes-openapi-json-file-which-is-highly-unstructured-json-file-on-weaviate/167/18 "2023-07-05T12:55:17Z")

</div>

Hey @jphwang!  
I have another query, if you can help me with that.

```auto
vector_store = WeaviateVectorStore(weaviate_client=client)
storage_context = StorageContext.from_defaults(vector_store=vector_store)
index = VectorStoreIndex.from_documents(data, storage_context=storage_context)
query_engine = index.as_query_engine()
response = query_engine.query(
        "xyz")

print(response)

```

In the code above, I am loading data into the Weaviate vector store using Llama-index. The problem here is that every time I ask for the query, the data is loaded all over again in Weavite. What I want is that once the data is indexed and stored in Weaviate, when I run the query, I want to get access to the already loaded data instead of indexing it all over again. How can I solve this issue?Preformatted text

---

<div class="post-metadata">

**Author:** ![jphwang](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/jphwang/32/38_2.png) [@jphwang](https://forum.weaviate.io/u/jphwang)\
**Post date:** [July 5, 2023, 7:22pm UTC](https://forum.weaviate.io/t/how-do-i-store-stripes-openapi-json-file-which-is-highly-unstructured-json-file-on-weaviate/167/19 "2023-07-05T19:22:44Z")

</div>

Hi @Vruti_Dobariya - could you please make a new thread per issue? That would help us to track each question and get help as needed. Thanks! 🙂

---

<div class="post-metadata">

**Author:** ![Vruti\_Dobariya](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/vruti_dobariya/32/145_2.png) [@Vruti\_Dobariya](https://forum.weaviate.io/u/Vruti_Dobariya)\
**Post date:** [July 6, 2023, 7:14am UTC](https://forum.weaviate.io/t/how-do-i-store-stripes-openapi-json-file-which-is-highly-unstructured-json-file-on-weaviate/167/20 "2023-07-06T07:14:45Z")

</div>

Yes, sure thing! Sorry for the inconvenience.
