Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define a schema valid for both startPeriod and endPeriod #102

Closed
ioggstream opened this issue Apr 20, 2020 · 2 comments
Closed

Define a schema valid for both startPeriod and endPeriod #102

ioggstream opened this issue Apr 20, 2020 · 2 comments
Assignees
Milestone

Comments

@ioggstream
Copy link
Contributor

I expect

To define a reusable schema valid for both startPeriod and endPeriod

components:
  schemas:
    SDMXPeriod:
       type: string
       pattern: '^\d{4}-?((\d{2}(-\d{2})?)|A1|S[1|2]|Q[1-4]|T[1-3]|M(0[1-9]|1[0-2])|W(0[1-9]|[1-4][0-9]|5[0-3])|D(0[0-9][1-9]|[1-2][0-9][0-9]|3[0-5][0-9]|36[0-6]))?$'
       description: |-
          Examples:
          * `2000`: Year (ISO 8601)
          * `2000-01`: Month (ISO 8601)
          * `2000-01-01`: Date (ISO 8601)
          * `2000-Q1`: Quarter (SDMX)
          * `2000-W01`: Week (SDMX)



startPeriod:
      in: query
      name: startPeriod
      description: |
        The start of the period for which results should be supplied (inclusive).
      schema:
         $ref: '#/components/schemas/SDMXPeriod'
      
@sosna sosna self-assigned this Apr 21, 2020
@sosna sosna added this to the v2.0.0 milestone Apr 21, 2020
@sosna sosna removed this from the v2.0.0 milestone Sep 3, 2020
@sosna sosna added normal and removed minor labels Feb 23, 2022
@sosna sosna changed the title openapi spec: define sdmx date Define a schema valid for both startPeriod and endPeriod Feb 23, 2022
@sosna sosna assigned dosse and unassigned sosna Mar 3, 2022
@sosna sosna added this to the v2.2.0 milestone May 24, 2024
@dosse
Copy link
Contributor

dosse commented Aug 2, 2024

For sdmx-json, we have the following json schema:

             "StandardTimePeriodType":{
                    "description":"StandardTimePeriodType defines the set of standard time periods in SDMX. This includes the reporting time periods and the basic date type (i.e. the calendar time periods and the dateTime format).",
                    "anyOf":[
                          {
                                 "description":"xs:gYear: GregorianTimePeriodType defines the set of standard calendar periods in SDMX.",
                                 "type":"string",
                                 "pattern":"^([1-9][0-9]{3,}|0[0-9]{3})(Z|([\\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?$](file://+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))%3f$)"
                          },
                          {
                                 "description":"xs:gYearMonth: GregorianTimePeriodType defines the set of standard calendar periods in SDMX.",
                                 "type":"string",
                                 "pattern":"^([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])(Z|([\\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?$](file://+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))%3f$)"
                          },
                          {
                                 "type":"string",
                                 "format":"date"
                          },
                          {
                                 "type":"string",
                                 "format":"date-time"
                          },
                          {
                                 "type":"string",
                                 "pattern":"^\\d{4}\\-([ASTQ][\\d{1}|[MW]\\d{2}|[D]\\d{3})(Z|((\\+|\\-)\\d{2}:\\d{2}))?$](file://d%7b1%7d|[MW]/d%7b2%7d|%5bD%5d/d%7b3%7d)(Z|((/+|/-)/d%7b2%7d:/d%7b2%7d))%3f$)",
                                 "description":"ReportingTimePeriodType defines standard reporting periods in SDMX, which are all in relation to the start day (day-month) of a reporting year which is specified in the specialized reporting year start day attribute. If the reporting year start day is not defined, a day of January 1 is assumed. The reporting year must be epxressed as the year at the beginning of the period. Therfore, if the reproting year runs from April to March, any given reporting year is expressed as the year for April. The general format of a report period can be described as  [year]-[period][time zone]?, where the type of period is designated with a single character followed by a number representing the period. Note that all periods allow for an optional time zone offset. See the details of each member type for the specifics of its format."
                          }
                    ]
             },

I hope that this is the information that was required.

@sosna
Copy link
Member

sosna commented Sep 5, 2024

Thanks, @dosse. This is no longer required, as startPeriod and endPeriod are no longer part of the v2 API.

@sosna sosna closed this as completed Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Published
Development

No branches or pull requests

3 participants