question about <Barber>, is a <Barbershop> only su...
# squarelibraries
s
question about Barber, is a Barbershop only supposed to hold localised barbers for one
Document
? Because only the last
installDocument()
gets taken into account and overrides all previous calls. so I'm running into
Document [MyDocument] is not installed in Barbershop
a
So conceptually a Barbershop is the store which you initially install all the documents and copy that it will need during app runtime. Then when you need to render, you get a barber from it which can handle that specific copy and output document. You should be able to use a BarbershopBuilder() and call install multiple times for different documents and templates. See example here: https://github.com/cashapp/barber#locale
🙏 1
s
Alright, I see. I think the docs never add multiple documents, only templates for different locales, so I wasn't sure about this. my issue was, I suppose, that my two documents were structurally the same (same fields, but different classname).
a
Further up in the docs in the Document section there are examples for what those different schema might look like. If all the output fields are the same, you probably only need a single document class.