<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Procotol-Buffers on Micha Kops&#39; Tech Notes</title>
    <link>https://www.hascode.com/tags/procotol-buffers/</link>
    <description>Recent content in Procotol-Buffers on Micha Kops&#39; Tech Notes</description>
    <generator>Hugo -- 0.147.8</generator>
    <language>en</language>
    <copyright>Copyright © 2010 - 2025 Micha Kops. #213243b1d6e8932079e09227d3f3ed0c806cd0c9</copyright>
    <lastBuildDate>Wed, 02 Feb 2022 00:00:00 +0100</lastBuildDate>
    <atom:link href="https://www.hascode.com/tags/procotol-buffers/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Converting XML Schema (XSD) to Protocol Buffers (Protobuf)</title>
      <link>https://www.hascode.com/converting-xml-schema-xsd-to-protocol-buffers-protobuf/</link>
      <pubDate>Wed, 02 Feb 2022 00:00:00 +0100</pubDate>
      <guid>https://www.hascode.com/converting-xml-schema-xsd-to-protocol-buffers-protobuf/</guid>
      <description>&lt;div id=&#34;preamble&#34;&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Sometimes one needs to derive a Google Protocol Buffers schema from an XML schema .. e.g. from an Enterprise Architect Export.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Tool used here: &lt;a href=&#34;https://github.com/entur/schema2proto/&#34;&gt;schema2proto (GitLab project)&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
&lt;h2 id=&#34;_steps&#34;&gt;Steps&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;olist arabic&#34;&gt;
&lt;ol class=&#34;arabic&#34;&gt;
&lt;li&gt;
&lt;p&gt;Download &lt;code&gt;schema2proto-lib&lt;/code&gt; from the global Maven repository: &lt;a href=&#34;https://search.maven.org/search?q=schema2proto&#34; class=&#34;bare&#34;&gt;https://search.maven.org/search?q=schema2proto&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Run &lt;code&gt;Schema2Proto&lt;/code&gt; against a give XSD schema file and with a given output directory:&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;pre&gt;java -jar schema2proto-lib-1.53.jar Schema2Proto --outputDirectory=src/main/protobuf input.xsd&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;A yaml config file may be given instead of cli parameters:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;pre class=&#34;highlight&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;java -jar schema2proto-lib-1.53.jar Schema2Proto ----configFile=config.yaml input.xsd&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;</description>
    </item>
  </channel>
</rss>
