alavrik / piqi

Piqi – universal schema language: JSON, XML, Protocol Buffers data validation and conversion
http://piqi.org
Apache License 2.0
246 stars 36 forks source link

Strange warning #6

Closed joelreymont closed 13 years ago

joelreymont commented 13 years ago

--- Doc.piqi

.ocaml-module "Doc" .proto-package "Doc"

.alias [ .name doc-id .type string ]

piqi to-proto Doc.piqi Warning: Doc.piqi:1:1: unknown field

What does this mean and how do I fix it?

alavrik commented 13 years ago

This warning means that piqi doesn't know anything about .ocaml-module field. This is because the language recognized by piqi is a subset of the language recognized by piqic.

There's a special (though, undocumented) method for avoiding such warnings. You need to specify

.custom-field ocaml-module

Somewhere in your .piqi module. See, for example, this module: https://github.com/alavrik/piqi/blob/master/piqi.org/piqast.piqi

You can specify the .custom-field property several times for as many fields as you like. For example, this module lists three custom fields: https://github.com/alavrik/piqi/blob/master/piqi.org/piqtype.piqi

joelreymont commented 13 years ago

Works for me, thanks!