GeethanadhP / xml-avro

Convert XSD -> AVSC and XML -> AVRO
Apache License 2.0
36 stars 26 forks source link

Unable to generate namespace - need advice #19

Closed kartgk closed 5 years ago

kartgk commented 5 years ago

We need to generate a namespace in the spec as below { "type" : "record", "name" : "userInfo", "namespace" : "my.example", "fields" : [{"name" : "age", "type" : "int"}] }

How to do that automatically when converting an xsd. Should we add anything to config.yml or something to xsd. Please guide.

GeethanadhP commented 5 years ago

why do you want to put the namespace in the there?? avsc has a pre-defined format, so putting anything there is useless, by default the namespace information goes into the source tag

this way for example "fields": [ { "name": "BookName", "type": [ "null", "string" ], "source": "element http://www.books.com/XML:BookName" } ]

kartgk commented 5 years ago

The namespace element will be used to generate Java classes in specified package / namespace. See the example mentioned here https://avro.apache.org/docs/1.8.2/gettingstartedjava.html

GeethanadhP commented 5 years ago

hey as i said i have already handled that by adding the namespace in the source, just try converting the code and get back if you have trouble..

I actually don't have much time to spend on this to re-write the funtionality that is working in a different way As they say "If it ain't broke, don't fix it"

kartgk commented 5 years ago

ok sure, Thanks for responding.

GeethanadhP commented 5 years ago

try using it once, see if you have trouble reading the data

but if you are trying to get only the avsc file then i can't help right now, but may be later in the future :)

GeethanadhP commented 5 years ago

closing the ticket as its not an issue