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

[FEATURE] GuiStracini.HolidayAPI.Model.Holiday - SubDivisions #78

Open
JazStringer opened this issue Jun 13, 2023 · 1 comment
Open
Labels

Comments

@JazStringer
Copy link

JazStringer commented Jun 13, 2023

Is your feature request related to a problem? Please describe.
After GetHolidaysAsync() is returned I am iterating through the results looking for the SubDivisions that the holiday is associated to;

Describe the solution you'd like
for a [SubDivisions] property string array of SubDivisions the holiday is associated to;

@guibranco guibranco self-assigned this Jun 22, 2023
@guibranco guibranco added enhancement help wanted .NET Pull requests that update .net code good first issue labels Jun 22, 2023
@guibranco
Copy link
Owner

To it work the subdivisions queryString must be set to true

Steps:

  • Allow an optional parameter to request
  • Map the subdivisions array of strings in the response

A sample request: https://holidayapi.com/v1/holidays?pretty&country=USA&year=2022&subdivisions=true&key=[API-KEY]

A sample response:

{
  "name": "Civil Rights Day",
  "date": "2022-01-17",
  "observed": "2022-01-17",
  "public": true,
  "country": "US",
  "uuid": "7068a05c-881f-4a74-9a36-829383316de7",
  "weekday": {
    "date": {
      "name": "Monday",
      "numeric": "1"
    },
    "observed": {
      "name": "Monday",
      "numeric": "1"
    }
  },
  "subdivisions": [
    "US-AZ",
    "US-NH"
  ]
}

@guibranco guibranco removed their assignment Jun 30, 2023
@guibranco guibranco changed the title GuiStracini.HolidayAPI.Model.Holiday - SubDivisions [FEATURE] GuiStracini.HolidayAPI.Model.Holiday - SubDivisions May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants