[3.0] urls argument should be optional
See original GitHub issueSince the default value of urls is an empty array, the urls argument should also be optional. I ran into this issue because I dynamically build my sitemap after initializing:
const sitemap = sm.createSitemap({
hostname: process.env.SITEMAP_HOSTNAME,
});
sitemap.add("/");
sitemap.add("/some_page");
After updating to 3.0, the above code triggers a type error but it works fine in 2.x
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5
Top Results From Across the Web
Django optional url parameters - Stack Overflow
The problem is that I want the project_id parameter to be optional. I want /project_config/ and /project_config/12345abdce/ to be equally valid ...
Read more >URL dispatcher - Django documentation
URLconfs have a hook that lets you pass extra arguments to your view functions, as a Python dictionary. The path() function can take...
Read more >Optional parameter in url · Issue #1289 · slimphp/Slim - GitHub
We need: Ability to specify optional parameters in the route path; Ability to generate urls via urlFor for routes that have optional parameters....
Read more >Describing Parameters - Swagger
By default, OpenAPI treats all request parameters as optional. You can add required: true to mark a parameter as required. Note that path...
Read more >Routing in ASP.NET Core - Microsoft Learn
An optional parameter has a value only when a value is provided by the request URL. Route parameters may have constraints that must...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Good spot, I’ll look at this tonight
@cekvenich looks like I missed it in the createSitemap function. You can instantiate sitemap directly for now as I did make that optional. See the definition of sitemap for the map of function to constructor.