forked from loafle/openapi-generator-original
[aspnet] Fix .sln/.xproj guids
The AspNet5 generator was originally written to support project.json. The Project.xproj was implemented without a valid project guid or root namespace. During the transition period from project.json to Project.xproj, VS2015 would fallback to project.json. Newer versions of VS2015 don't seem to do this any longer. This commit defines the project's guid correctly, and sets the project's root namespace. See: #3680
This commit is contained in:
@@ -9,10 +9,14 @@ import org.slf4j.LoggerFactory;
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
|
||||
import static java.util.UUID.randomUUID;
|
||||
|
||||
public class AspNet5ServerCodegen extends AbstractCSharpCodegen {
|
||||
|
||||
protected String sourceFolder = "src" + File.separator + packageName;
|
||||
|
||||
private final String packageGuid = "{" + randomUUID().toString().toUpperCase() + "}";
|
||||
|
||||
@SuppressWarnings("hiding")
|
||||
protected Logger LOGGER = LoggerFactory.getLogger(AspNet5ServerCodegen.class);
|
||||
|
||||
@@ -81,6 +85,8 @@ public class AspNet5ServerCodegen extends AbstractCSharpCodegen {
|
||||
public void processOpts() {
|
||||
super.processOpts();
|
||||
|
||||
additionalProperties.put("packageGuid", packageGuid);
|
||||
|
||||
apiPackage = packageName + ".Controllers";
|
||||
modelPackage = packageName + ".Models";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user