You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I defined a schema and want to render the example in XML. Everything goes pretty well, but elements of string type don't render any attributes. And xml attributes in different namespaces do not show the corresponding namespace or prefix. This results in faulty examples that are not accepted by my server.
Example Swagger/OpenAPI definition:
openapi: 3.0.3info:
title: Servicelayer SKOS APIdescription: |version: 1.0.0paths:
/api/concept:
post:
tags:
- ConceptsrequestBody:
content:
application/rdf+xml:
schema:
$ref: '#/components/schemas/Concept'responses:
'201':
description: 'Concept candidate created succesfully. Note, the returned data will contain the subjectIDs generated by the system. NOTE: the XML attributes require namespace prefix, which are omitted by this OpenAPI documentation''s renderer!!!'components:
schemas:
Concept:
type: objectdescription: Concept RDFWrapperxml:
name: RDFprefix: rdfnamespace: http://www.w3.org/1999/02/22-rdf-syntax-ns#wrapped: trueproperties:
concept:
$ref: '#/components/schemas/ConceptDescription'ConceptDescription:
type: objectxml:
name: Descriptionprefix: rdfnamespace: http://www.w3.org/1999/02/22-rdf-syntax-ns#properties:
about:
type: stringdescription: the concept's subjectID. Only valid for updates of existing conceptsexample: http://data.beeldengeluid.nl/gtaa/12345xml:
prefix: rdfnamespace: http://www.w3.org/1999/02/22-rdf-syntax-ns#attribute: truetype:
type: objectxml:
prefix: rdfnamespace: http://www.w3.org/1999/02/22-rdf-syntax-ns#properties:
resource:
type: stringenum: ['http://www.w3.org/2004/02/skos/core#Concept']example: http://www.w3.org/2004/02/skos/core#Conceptxml:
prefix: rdfnamespace: http://www.w3.org/1999/02/22-rdf-syntax-ns#attribute: trueprefLabel:
$ref: '#/components/schemas/Label'hasTopConcept:
$ref: '#/components/schemas/RdfRef'RdfRef:
type: objectxml:
prefix: skosnamespace: http://www.w3.org/2004/02/skos/core#properties:
resource:
type: stringexample: 'http://data.beeldengeluid.nl/gtaa/--something--'xml:
attribute: trueprefix: rdfnamespace: http://www.w3.org/1999/02/22-rdf-syntax-ns#Label:
type: stringexample: 'my text'xml:
prefix: skosnamespace: http://www.w3.org/2004/02/skos/core#properties:
lang:
type: stringexample: 'nl'xml:
attribute: trueprefix: xmlnamespace: http://www.w3.org/XML/1998/namespace
From http://www.xmlplease.com/xml/attributexmlns/
An attribute never inherits the namespace of its parent element. For that reason an attribute is only in a namespace if it has a proper namespace prefix. An attribute can never be in a default namespace
The text was updated successfully, but these errors were encountered:
Q&A (please complete the following information)
Content & configuration
I defined a schema and want to render the example in XML. Everything goes pretty well, but elements of string type don't render any attributes. And xml attributes in different namespaces do not show the corresponding namespace or prefix. This results in faulty examples that are not accepted by my server.
Example Swagger/OpenAPI definition:
Swagger-UI configuration options:
Describe the bug you're encountering
xml attributes are not rendered correctly in example:
To reproduce...
Steps to reproduce the behavior:
Actual behaviour
Expected behavior
I expect attribute namespaces, attribute prefixes and attributes of non object type elements to be shown in the example xml:
So I expect:
rdf:about="http://example.com" (prefix not rendered in embedded property of ConceptDescription)
rdf:resource="http://www.w3.org/2004/02/skos/core#Concept" (prefix not rendered in embedded property of ConceptDescription)
xml:lang="nl" (attribute missing in Label, a string type)
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" rdf:resource="http://example.com/--something--" (namespace and prefix missing in RdfRef)
Additional context or thoughts
From http://www.xmlplease.com/xml/attributexmlns/
An attribute never inherits the namespace of its parent element. For that reason an attribute is only in a namespace if it has a proper namespace prefix. An attribute can never be in a default namespace
The text was updated successfully, but these errors were encountered: