4ce861c8ad
This patch adds support for XML validation with RelaxNG. The original S3 schema is available at http://doc.s3.amazonaws.com/2006-03-01/AmazonS3.xsd, but I write a schema for swift3 from scratch. It is because: - The original schema does not support all of the latest S3 API. Even if we use it, we have to update and maintain it in either way. - The original schema is written with XML Schema, but the language is not enough to describe some of the latest S3 API. For example, the Multi-Object Delete operation sends an XML document, which can interleave a Quiet element with Object elements. XML Schema cannot define such kinds of XML documents. This patch includes both RelaxNG (rng) and RelaxNG compact syntax files (rnc) for validation. What I wrote are only rnc files, and rng files are automatically generated from rnc with trang, the most well-known schema converter. If possible, I'd like to use only rnc schemas since rng files are complicated and not so human-readable. However, lxml doesn't support RelaxNG compact syntax currently, unfortunately. After lxml supports compact syntax, let's remove all of the rng files. This patch also fixes some XML errors detected by RelaxNG validator, and some helper methods to convert strings between camel-case name and snake-case name. Change-Id: I4513345a6b981efc5d5f5e8cf528aba84ac1bdad
23 lines
670 B
Plaintext
23 lines
670 B
Plaintext
include "common.rnc"
|
|
|
|
start =
|
|
element ListPartsResult {
|
|
element Bucket { xsd:string },
|
|
element Key { xsd:string },
|
|
element UploadId { xsd:string },
|
|
element Initiator { CanonicalUser },
|
|
element Owner { CanonicalUser },
|
|
element StorageClass { StorageClass },
|
|
element PartNumberMarker { xsd:int },
|
|
element NextPartNumberMarker { xsd:int },
|
|
element MaxParts { xsd:int },
|
|
element EncodingType { xsd:string }?,
|
|
element IsTruncated { xsd:boolean },
|
|
element Part {
|
|
element PartNumber { xsd:int },
|
|
element LastModified { xsd:dateTime },
|
|
element ETag { xsd:string },
|
|
element Size { xsd:long }
|
|
}*
|
|
}
|