Closed Msa360 closed 12 months ago
Thank you for the contribution, but I don't think it's quite that simple. This library could be used in applications that are running constantly without being restarted. If the year is defaulted in the endpoint definition, it will only be set once when the library is loaded. If the application is running through July and into August, the year in the endpoint definition would not be updated to the next year.
However, I found two things while I was looking into this.
https://statsapi.mlb.com/api/v1/draft2019
and throwing an error. I am fixing the logic to include leading and trailing slashes even when default path parameter values are used.""
(empty string). The API will default to the current year (currently defaulting to 2023). In order to allow a blank default, I am updating the parameter to not be required (the URL builder logic does not allow an empty string for a required parameter).I am going to close this pull request, and release these two changes in v1.7. Thank you!
Checks if we are passed the draft month (July) and if not puts the previous year, else the current year.