[
https://issues.apache.org/jira/browse/THRIFT-3417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15003480#comment-15003480
]
ASF GitHub Bot commented on THRIFT-3417:
----------------------------------------
GitHub user bgould opened a pull request:
https://github.com/apache/thrift/pull/691
THRIFT-3417: "namespace xsd" is not really working
Added support for annotations on namespaces in IDL. This allows for
specifying a namespace uri like this:
`namespace xsd test (uri = 'http://my.example.com/')`
Updated XSD generator to take advantage of this new feature in order to
generate namespace URIs based off of the annotation, unless no annotation is
present - in which case the fallback behavior is to use the value of
`program_->get_namespace("xsd")` as it was previously.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/bgould/thrift THRIFT-3417
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/thrift/pull/691.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #691
----
commit 3e3fdcf600defc54576f55ef47ca0392478f2f64
Author: BCG <[email protected]>
Date: 2015-11-13T02:02:51Z
THRIFT-3417: "namespace xsd" is not really working
Added support for annotations on namespaces in IDL. This allows for
specifying a namespace uri like this:
namespace xsd test (uri = 'http://my.example.com/')
Updated XSD generator to take advantage of this new feature in order to
generate namespace URIs based off of the annotation, unless no annotation is
present - in which case the fallback behavior is to use the value of
program_->get_namespace("xsd") as it was previously.
----
> "namespace xsd" is not really working
> -------------------------------------
>
> Key: THRIFT-3417
> URL: https://issues.apache.org/jira/browse/THRIFT-3417
> Project: Thrift
> Issue Type: Bug
> Components: Compiler (General)
> Reporter: Jens Geyer
>
> The {{namespace xsd}} statement can be used to put namespace declarations
> into the xsd. So far, so expected,. What makes it a problem is the fact, that
> normal languages need an identifier here. In that regard, XSD is different,
> because this should be possible to do this:
> {code:xml}
> <?xml version="1.0" encoding="UTF-8" ?>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> targetNamespace="http://example.com" xmlns="http://example.com"
> elementFormDefault="qualified">
> <!-- ... stuff ... -->
> </xsd:schema>
> {code}
> However, there is no way to express this in the IDL. The foillowing leads to
> an syntax error, because the value is expected to be an identifier even for
> xsd.
> {code:title=example.thrift}
> namespace xsd "http://example.com"
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)